Upgrade OJS-2.4.7.1 to OJS-2.4.8 Patches Missing?

I downloaded the latest OJS-2.4.8 from PKP to do a check against my installations.
I then ran php upgrade.php patch as well as php upgrade.php upgrade.for one of my journals that had patches applied to it.
Once the upgrade was finished I ran a diff of this journal upgrade against the OJS-2.4.8 that I had downloaded. I could be wrong but it looks like a number of patches did not get into the OJS-2.4.8 base code when the tar.gz file was created.
Can someone please confirm.

Here is the output of the diff run:-


diff -ur iejll/lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php ojs-2.4.8/lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php
--- iejll/lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php    2016-04-04 06:18:52.154422025 -0600
+++ ojs-2.4.8/lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php    2016-02-05 18:01:27.000000000 -0700
@@ -338,8 +338,8 @@
             FROM announcements
             WHERE assoc_type = ?
                 AND assoc_id = ?
-                AND (date_expire IS NULL OR date_expire >= CURRENT_DATE)
-                AND (date_posted < CURRENT_DATE)
+                AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
+                AND (DATE(date_posted) <= CURRENT_DATE)
             ORDER BY announcement_id DESC',
             array((int) $assocType, (int) $assocId),
             $rangeInfo
@@ -360,8 +360,8 @@
             FROM announcements
             WHERE assoc_type = ?
                 AND assoc_id = ?
-                AND (date_expire IS NULL OR date_expire >= CURRENT_DATE)
-                AND (date_posted < CURRENT_DATE)
+                AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
+                AND (DATE(date_posted) <= CURRENT_DATE)
             ORDER BY announcement_id DESC LIMIT ?',
             array((int) $assocType, (int) $assocId, (int) $numAnnouncements),
             $rangeInfo
@@ -382,8 +382,8 @@
             FROM    announcements
             WHERE    assoc_type = ?
                 AND assoc_id = ?
-                AND (date_expire IS NULL OR date_expire >= CURRENT_DATE)
-                AND (date_posted < CURRENT_DATE)
+                AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
+                AND (DATE(date_posted) <= CURRENT_DATE)
             ORDER BY announcement_id DESC LIMIT 1',
             array((int) $assocType, (int) $assocId)
         );
diff -ur iejll/lib/pkp/classes/mail/Mail.inc.php ojs-2.4.8/lib/pkp/classes/mail/Mail.inc.php
--- iejll/lib/pkp/classes/mail/Mail.inc.php    2016-04-04 06:18:52.406422024 -0600
+++ ojs-2.4.8/lib/pkp/classes/mail/Mail.inc.php    2016-02-05 18:01:27.000000000 -0700
@@ -353,7 +353,7 @@
      */
     function getReplyToString($send = false) {
         $replyTo = $this->getReplyTo();
-        if (!array_key_exists('email', $replyTo) || $replyTo['email'] == null) {
+        if ($replyTo == null) {
             return null;
         } else {
             return (Mail::encodeDisplayName($replyTo['name'], $send) . ' <'.$replyTo['email'].'>');
diff -ur iejll/plugins/importexport/crossref/CrossRefExportPlugin.inc.php ojs-2.4.8/plugins/importexport/crossref/CrossRefExportPlugin.inc.php
--- iejll/plugins/importexport/crossref/CrossRefExportPlugin.inc.php    2016-04-04 06:19:02.130421962 -0600
+++ ojs-2.4.8/plugins/importexport/crossref/CrossRefExportPlugin.inc.php    2016-02-05 17:59:42.000000000 -0700
@@ -120,7 +120,7 @@
         $this->registerDaoHook('IssueDAO');
         $issueIterator =& $issueDao->getPublishedIssues($journal->getId(), Handler::getRangeInfo('issues'));
 
-        // Get issues that should be excluded i.e. that have no DOI to export/register.
+        // Get issues that should be excluded i.e. that have no objects eligible to export/register.
         $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
         $excludes = array();
         $allExcluded = true;
@@ -133,7 +133,7 @@
             foreach ($issueArticles as $issueArticle) {
                 $articleRegistered = $issueArticle->getData($this->getPluginId().'::registeredDoi');
                 $errors = array();
-                if ($this->canBeExported($issueArticle, $errors) && !isset($articleRegistered)) {
+                if ($this->canBeExported($issueArticle, $errors)) {
                     $excludes[$issue->getId()] = false;
                     $allExcluded = false;
                     $issueArticlesNo++;
@@ -143,13 +143,15 @@
                 }
             }
             $numArticles[$issue->getId()] = $issueArticlesNo;
+            unset($issue);
         }
+        unset($issueIterator);
 
         // Prepare and display the issue template.
-        // Get the issue iteratorf from the DB for the template again.
+        // Get the issue iterator from the DB for the template again.
         $issueIterator =& $issueDao->getPublishedIssues($journal->getId(), Handler::getRangeInfo('issues'));
         $templateMgr->assign_by_ref('issues', $issueIterator);
-        $templateMgr->assign_by_ref('allExcluded', $allExcluded);
+        $templateMgr->assign('allExcluded', $allExcluded);
         $templateMgr->assign('excludes', $excludes);
         $templateMgr->assign('numArticles', $numArticles);
         $templateMgr->assign('allArticlesRegistered', $allArticlesRegistered);
@@ -256,7 +258,6 @@
                 }
             }
         }
-        return false;
     }
 
     /**
diff -ur iejll/plugins/importexport/datacite/classes/DOIExportPlugin.inc.php ojs-2.4.8/plugins/importexport/datacite/classes/DOIExportPlugin.inc.php
--- iejll/plugins/importexport/datacite/classes/DOIExportPlugin.inc.php    2016-04-04 06:19:02.434421960 -0600
+++ ojs-2.4.8/plugins/importexport/datacite/classes/DOIExportPlugin.inc.php    2016-02-05 17:59:42.000000000 -0700
@@ -481,24 +481,26 @@
         $this->registerDaoHook('IssueDAO');
         $issueIterator =& $issueDao->getPublishedIssues($journal->getId(), Handler::getRangeInfo('issues'));
 
-        // Filter only issues that can be exported.
-        $issues = array();
+        // Get issues that should be excluded i.e. that have no DOI.
+        $excludes = array();
+        $allExcluded = true;
         while ($issue =& $issueIterator->next()) {
+            $excludes[$issue->getId()] = true;
             $errors = array();
             if ($this->canBeExported($issue, $errors)) {
-                $issues[] =& $issue;
+                $excludes[$issue->getId()] = false;
+                $allExcluded = false;
             }
             unset($issue);
         }
         unset($issueIterator);
 
-        // Instantiate issue iterator.
-        import('lib.pkp.classes.core.ArrayItemIterator');
-        $rangeInfo = Handler::getRangeInfo('articles');
-        $iterator = new ArrayItemIterator($issues, $rangeInfo->getPage(), $rangeInfo->getCount());
-
         // Prepare and display the issue template.
-        $templateMgr->assign_by_ref('issues', $iterator);
+        // Get the issue iterator from the DB for the template again.
+        $issueIterator =& $issueDao->getPublishedIssues($journal->getId(), Handler::getRangeInfo('issues'));
+        $templateMgr->assign_by_ref('issues', $issueIterator);
+        $templateMgr->assign('allExcluded', $allExcluded);
+        $templateMgr->assign('excludes', $excludes);
         $templateMgr->display($this->getTemplatePath() . 'issues.tpl');
     }
    `

Thanks,
Edward

Hi @EdwardDavid,

Could you reformat that post so that the diff doesn’t get interpreted as markdown?

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I took the diff code out until I can format it properly.
What do you use to reformat the diff code?
First time I have posted a diff to this forum.

Thanks,
Edward

Hi @EdwardDavid,

This forum uses markdown, so see e.g. the section titled “Code” in this reference.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Thanks, much appreciated. I reformatted the code

Thanks,
Edward

Hi @EdwardDavid,

Looking at the first entry in the .diff (for PKPAnnouncementDAO.inc.php), I do see that appearing in the OJS 2.4.7-1 to 2.4.8 patch. This suggests that the patch wasn’t fully applied. Do you have the output available from the patch application?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Yes I have the ojs2-2.4.8.0.patch file.
Alec, what I was doing was comparing my ojs-2.4.7.1 upgrade to ojs-2.4.8.
Then I was comparing my journal that was upgraded to 2.4.8 to the download from https://pkp.sfu.ca/ojs/ojs_download/ where it says Download OJS 2.4.8 (.tar.gz) I wanted to make sure they matched.

Thanks,
Edward

Hi @EdwardDavid,

So you started with OJS 2.4.7-1, then applied the 2.4.7-1 to 2.4.8 patch, then compared the result to a fresh 2.4.8 download?

If so, then that’s what I understood above. Do you have the output available from the patch application?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Yes your understanding is correct.
I have the patch file that got downloaded but I do not have any output from running the patch application.
It would be nice if when the php upgrade.php patch was run that it actual created an output file that one could look at afterwords. Especially if the patch said errors during patch updates.

Thanks,
Edward

Hi @EdwardDavid,

The upgrade script is just a wrapper around the standard patch tool, which generates output on patch status to standard output. Check to see whether it also generated any .rej files, e.g.:

find . -name \*.rej

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
These are the files:-
./lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php.rej
./plugins/importexport/crossref/templates/issues.tpl.rej
./plugins/importexport/crossref/CrossRefExportPlugin.inc.php.rej
./plugins/importexport/datacite/classes/DOIExportPlugin.inc.php.rej

Here is the first one:-

--- lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php     2015-10-22 17:31:44.000000000 -0700
+++ lib/pkp/classes/announcement/PKPAnnouncementDAO.inc.php     2016-02-05 17:01:27.632927289 -0800
@@ -338,8 +338,8 @@
                        FROM announcements
                        WHERE assoc_type = ?
                                AND assoc_id = ?
-                               AND (date_expire IS NULL OR date_expire > CURRENT_DATE)
-                               AND (date_posted < CURRENT_DATE)
+                               AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
+                               AND (DATE(date_posted) <= CURRENT_DATE)
                        ORDER BY announcement_id DESC',
                        array((int) $assocType, (int) $assocId),
                        $rangeInfo
@@ -360,8 +360,8 @@
                        FROM announcements
                        WHERE assoc_type = ?
                                AND assoc_id = ?
-                               AND (date_expire IS NULL OR date_expire > CURRENT_DATE)
-                               AND (date_posted < CURRENT_DATE)
+                               AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
+                               AND (DATE(date_posted) <= CURRENT_DATE)
                        ORDER BY announcement_id DESC LIMIT ?',
                        array((int) $assocType, (int) $assocId, (int) $numAnnouncements),
                        $rangeInfo
@@ -382,8 +382,8 @@
                        FROM    announcements
                        WHERE   assoc_type = ?
                                AND assoc_id = ?
-                               AND (date_expire IS NULL OR date_expire > CURRENT_DATE)
-                               AND (date_posted < CURRENT_DATE)
+                               AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
+                               AND (DATE(date_posted) <= CURRENT_DATE)
                        ORDER BY announcement_id DESC LIMIT 1',
                        array((int) $assocType, (int) $assocId)
                );

Thanks,
Edward

Hi @EdwardDavid,

Those will be sections of the upgrade patch that could not be applied, typically due to local modifications. Those should’ve been flagged in the output of the patch tool. You’ll need to apply those manually.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

What I was trying to point out in the first message with the code.
Was that the patches do not look like they are in the 2.4.8 that I downloaded from your site.
I had applied patches to 2.4.7.1 and they were still there with the 2.4.8 upgrade.
I verified it with the Mail.inc.php $replyTo patch. It has not been applied to your OJS2.4.8 full package download.

Hope that helps clarify what I am trying to say.

Thanks,
Edward

Hi @EdwardDavid,

It looks like you’re referring to this patch?

That was written on February 23, and OJS 2.4.8 was released on February 5. That patch will be included in the OJS 2.4.9 release.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks that helps to understand the process a little bit better.

When do you think that OJS 2.4.9 will be released?

Thanks,
Edward

Hi @EdwardDavid,

It’s not scheduled yet, but once we get the OMP 1.2 release out of the way we’ll sort out our release plans for the summer/fall.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

I was reading this thread this morning. I have a question for you that ties into this thread.
You are referencing a patch that was written after the OJS-2.4.8 version was released.
How do find all patches that have been written after the OJS-2.4.8 release date?

That way I can make sure all patches have been applied.

Thanks,
Edward

Hi @EdwardDavid,

The best way is to host using git from the ojs-stable-2_4_8 branch; for a list, you can look at Recommended Patches.

Regards,
Alec Smecher
Public Knowledge Project Team