Patch failed to apply during upgrade

Hello all,

Just attempted to upgrade my OJS installation.
Since a few customizations were made, I assume the patch would fail somewhere, so I ran:
find ./ -name *.rej

These were the result of that find command:

./lib/pkp/plugins/citationLookup/crossref/locale/es_ES/locale.xml.rej
./lib/pkp/locale/en_US/admin. xml.rej
./lib/pkp/locale/pt_BR/admin.xml.rej

I ran a check then upgraded the database…
Should I restore to the previous version, download the new one, upgrade the database then proceed with my customizations or these are ok to live with?

No database errors were reported… I ran this as root on the server without changing the permissions/ownership…

Since each of these are locale files, you may have lost some translation changes, but the changes to the PHP files appear intact.

I would generally recommend the steps of:

  • performing the code upgrade
  • reconciling local modifications
  • performing the database upgrade
    in that order.

It looks, however, that you should be ok resolving these translation changes after-the-fact.

Hello @ctgraham,

Thanks… I checked the .rej files and added the keys to the en_US.
Then I’ll just use the Translator Plugin to update translation…

Upon updating some of the missing translations, I came up to the following messages:
Missing Locale Files
The locale file “” is missing or unreadable. CREATE
The locale file “” is missing or unreadable. CREATE

Any idea what this is?
Maybe I should restore backup and try again?

Anyone experienced the blank locale files missing message?

The absence of a filename in error message is unhelpful.

I would suggest comparing your patched version to a clean download. Review the differences via version control (git, mercurial, subversion) or via a tool such as diff or WinMerge.

You may find an unintentional change as part of the merging.

Hello all,

Since I can’t upload de DIFF file, I paste its content… sorry.
Apparently, just language files are the issue… Some files are not ojs, but used for testing purposes…

Only in devojs.ibict.br/cache: 6d48fedbfe1fcbbb7f4887e44f87befa.gz
Only in devojs.ibict.br/cache: fc-helpmap-f31a116d22d6c14f4f09c3d1fba38278.php
Only in devojs.ibict.br/cache: fc-locale-03b174b61510807426c2a2c128f6a86a.php
Only in devojs.ibict.br/cache: fc-locale-0a18a93b344241c866d64e18baeabb75.php
Only in devojs.ibict.br/cache: fc-locale-0eff871d8e03233acda4bf07b56efeb8.php
Only in devojs.ibict.br/cache: fc-locale-1cfde42be2b25bdac1c9a16538de37a8.php
Only in devojs.ibict.br/cache: fc-locale-2fbbe635963c566bfacea5c8449ae019.php
Only in devojs.ibict.br/cache: fc-locale-30ade3af71c390241cfe899534e36d36.php
Only in devojs.ibict.br/cache: fc-locale-39ad57a0a799a092b476f7b3d029e60d.php
Only in devojs.ibict.br/cache: fc-locale-5dd9630a81f2583c22107b46e5ce9966.php
Only in devojs.ibict.br/cache: fc-locale-61dc07b427ce97bc92a77478efafd6bc.php
Only in devojs.ibict.br/cache: fc-locale-74a06b98a21881c0c27b82897282d04b.php
Only in devojs.ibict.br/cache: fc-locale-95d24e09ab8af6f9bb8a02f637efbefb.php
Only in devojs.ibict.br/cache: fc-locale-96aaa80660bbcb2f60b6516cedd6c363.php
Only in devojs.ibict.br/cache: fc-locale-9ac3e959801c2a71b70855a9f0c11ef0.php
Only in devojs.ibict.br/cache: fc-locale-9e19df87188c49e74348db94de352bf3.php
Only in devojs.ibict.br/cache: fc-locale-af1cd48677ffc63fcc9fbc520820bb6f.php
Only in devojs.ibict.br/cache: fc-locale-c95d7911b8b0da12d45eb2b0c884164c.php
Only in devojs.ibict.br/cache: fc-locale-c984a9f2e9f815ad7d09ac78ec3ceb57.php
Only in devojs.ibict.br/cache: fc-locale-d361f6493b84f04da16487147dee41ca.php
Only in devojs.ibict.br/cache: fc-locale-e02dd96e8d267fe4b8203f70e692ce76.php
Only in devojs.ibict.br/cache: fc-locale-e8d99fb9fe9fb4957ce4229b59a9b633.php
Only in devojs.ibict.br/cache: fc-locale-f90252dc6a63da3f259c3add542b2e84.php
Only in devojs.ibict.br/cache: fc-locale-fd8775eb0e300ffe8b09bc9aa449efb0.php
Only in devojs.ibict.br/cache: fc-locale-fedacd30b79364682634c139299a4489.php
Only in devojs.ibict.br/cache: fc-locale-list.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-acronplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-backupplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-coinsplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-customnavbarblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-developedbyblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-donationblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-fontsizeblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-helpblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-hidesidebarsblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-languagetoggleblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-navigationblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-notificationblockplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-tinymceplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-translatorplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-usageeventplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-usagestatsplugin.php
Only in devojs.ibict.br/cache: fc-pluginSettings-0-userblockplugin.php
Only in devojs.ibict.br/cache: fc-siteSettings-site.php
Only in devojs.ibict.br/cache: HTML
Only in devojs.ibict.br/cache/t_compile: %%2E^2EA^2EA8B57F%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%32^32D^32D13D85%%header.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%36^36E^36E89D0E%%header.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%37^37A^37A1C0D2%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%3D^3D1^3D184556%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%3D^3DF^3DF5686C%%jsLocaleKeys.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%43^43A^43AF8534%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%4B^4B4^4B45D846%%breadcrumbs.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%4C^4C3^4C31B0EB%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%56^561^5616391A%%minifiedScripts.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%5A^5A5^5A5A0067%%index.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%BE^BEE^BEEF0FA2%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%CB^CB6^CB620954%%footer.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%CB^CB7^CB767E56%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%CF^CF5^CF5BA9DF%%footer.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%EC^EC1^EC1BEFC2%%block.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%EC^EC1^EC1C53D0%%navbar.tpl.php
Only in devojs.ibict.br/cache/t_compile: %%EC^EC7^EC7459A2%%block.tpl.php
Files ojs-2.4.8/config.inc.php and devojs.ibict.br/config.inc.php differ
Only in devojs.ibict.br: config.inc.php.orig
Files ojs-2.4.8/favicon.ico and devojs.ibict.br/favicon.ico differ
Only in devojs.ibict.br: favicon-pkp.ico
Only in devojs.ibict.br: files
Files ojs-2.4.8/lib/pkp/js/functions/fontController.js and devojs.ibict.br/lib/pkp/js/functions/fontController.js differ
Only in devojs.ibict.br/lib/pkp/locale/en_US: admin.xml.orig
Only in devojs.ibict.br/lib/pkp/locale/en_US: admin.xml.rej
Files ojs-2.4.8/lib/pkp/locale/es_ES/admin.xml and devojs.ibict.br/lib/pkp/locale/es_ES/admin.xml differ
Files ojs-2.4.8/lib/pkp/locale/es_ES/installer.xml and devojs.ibict.br/lib/pkp/locale/es_ES/installer.xml differ
Files ojs-2.4.8/lib/pkp/locale/es_ES/manager.xml and devojs.ibict.br/lib/pkp/locale/es_ES/manager.xml differ
Files ojs-2.4.8/lib/pkp/locale/pt_BR/admin.xml and devojs.ibict.br/lib/pkp/locale/pt_BR/admin.xml differ
Only in devojs.ibict.br/lib/pkp/locale/pt_BR: admin.xml.orig
Only in devojs.ibict.br/lib/pkp/locale/pt_BR: admin.xml.rej
Files ojs-2.4.8/lib/pkp/locale/pt_BR/installer.xml and devojs.ibict.br/lib/pkp/locale/pt_BR/installer.xml differ
Files ojs-2.4.8/lib/pkp/locale/pt_BR/manager.xml and devojs.ibict.br/lib/pkp/locale/pt_BR/manager.xml differ
Files ojs-2.4.8/lib/pkp/locale/pt_BR/user.xml and devojs.ibict.br/lib/pkp/locale/pt_BR/user.xml differ
Files ojs-2.4.8/lib/pkp/plugins/citationLookup/crossref/locale/es_ES/locale.xml and devojs.ibict.br/lib/pkp/plugins/citationLookup/crossref/locale/es_ES/locale.xml differ
Only in devojs.ibict.br/lib/pkp/plugins/citationLookup/crossref/locale/es_ES: locale.xml.orig
Only in devojs.ibict.br/lib/pkp/plugins/citationLookup/crossref/locale/es_ES: locale.xml.rej
Files ojs-2.4.8/lib/pkp/styles/common.css and devojs.ibict.br/lib/pkp/styles/common.css differ
Files ojs-2.4.8/lib/pkp/templates/common/header.tpl and devojs.ibict.br/lib/pkp/templates/common/header.tpl differ
Only in devojs.ibict.br: listusers.php
Files ojs-2.4.8/locale/en_US/locale.xml and devojs.ibict.br/locale/en_US/locale.xml differ
Only in devojs.ibict.br/locale/en_US: locale.xml.orig
Files ojs-2.4.8/locale/es_ES/locale.xml and devojs.ibict.br/locale/es_ES/locale.xml differ
Files ojs-2.4.8/locale/pt_BR/locale.xml and devojs.ibict.br/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/locale/pt_BR/manager.xml and devojs.ibict.br/locale/pt_BR/manager.xml differ
Only in ojs-2.4.8/plugins/blocks/authorBios: orcid.png
Only in devojs.ibict.br/plugins/blocks: customnavbar
Files ojs-2.4.8/plugins/blocks/fontSize/block.tpl and devojs.ibict.br/plugins/blocks/fontSize/block.tpl differ
Only in devojs.ibict.br/plugins/blocks: hidesidebars
Files ojs-2.4.8/plugins/blocks/user/locale/es_ES/locale.xml and devojs.ibict.br/plugins/blocks/user/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/blocks/user/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/blocks/user/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/generic/dataverse/locale/es_ES/locale.xml and devojs.ibict.br/plugins/generic/dataverse/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/generic/dataverse/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/generic/dataverse/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/generic/googleAnalytics/locale/es_ES/locale.xml and devojs.ibict.br/plugins/generic/googleAnalytics/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/generic/googleAnalytics/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/generic/googleAnalytics/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/generic/objectsForReview/locale/es_ES/locale.xml and devojs.ibict.br/plugins/generic/objectsForReview/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/generic/objectsForReview/locale/pt_BR/emailTemplates.xml and devojs.ibict.br/plugins/generic/objectsForReview/locale/pt_BR/emailTemplates.xml differ
Files ojs-2.4.8/plugins/generic/objectsForReview/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/generic/objectsForReview/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/generic/pln/locale/en_US/locale.xml and devojs.ibict.br/plugins/generic/pln/locale/en_US/locale.xml differ
Only in devojs.ibict.br/plugins/generic/pln/locale/en_US: locale.xml.orig
Only in devojs.ibict.br/plugins/generic/pln/locale: es_ES
Files ojs-2.4.8/plugins/generic/pln/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/generic/pln/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/generic/staticPages/StaticPagesEditForm.inc.php and devojs.ibict.br/plugins/generic/staticPages/StaticPagesEditForm.inc.php differ
Files ojs-2.4.8/plugins/generic/usageStats/locale/es_ES/locale.xml and devojs.ibict.br/plugins/generic/usageStats/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/generic/usageStats/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/generic/usageStats/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/importexport/crossref/locale/es_ES/locale.xml and devojs.ibict.br/plugins/importexport/crossref/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/importexport/crossref/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/importexport/crossref/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/importexport/datacite/locale/es_ES/locale.xml and devojs.ibict.br/plugins/importexport/datacite/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/importexport/datacite/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/importexport/datacite/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/importexport/doaj/locale/es_ES/locale.xml and devojs.ibict.br/plugins/importexport/doaj/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/importexport/doaj/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/importexport/doaj/locale/pt_BR/locale.xml differ
Only in devojs.ibict.br/plugins/metadata/dc11/locale: pt_BR
Files ojs-2.4.8/plugins/pubIds/doi/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/pubIds/doi/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/pubIds/urn/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/pubIds/urn/locale/pt_BR/locale.xml differ
Files ojs-2.4.8/plugins/reports/counter/locale/es_ES/locale.xml and devojs.ibict.br/plugins/reports/counter/locale/es_ES/locale.xml differ
Files ojs-2.4.8/plugins/reports/counter/locale/pt_BR/locale.xml and devojs.ibict.br/plugins/reports/counter/locale/pt_BR/locale.xml differ
Only in devojs.ibict.br/plugins/themes: ibict2015
Only in devojs.ibict.br/public: journals
Only in devojs.ibict.br/public: site
Files ojs-2.4.8/styles/common.css and devojs.ibict.br/styles/common.css differ
Only in devojs.ibict.br: users.xml

I think the message ‘The locale file “” is missing or unreadable.’ is caused by a different number of locale files in the en_US translation of a plugin vs the other translations (such as COUNTER now does in 2.4.8). In the COUNTER and 2.4.8 example, the Translator plugin cannot correctly determine that the en_US ar1.xml and jr1.xml files should also exist as the same names in the other locales.

This won’t directly impact your install, except that you will not be able to use the Translator plugin to edit or create these files.

The fix for this issue will likely lie somewhere in TranslatorAction.inc.php’s testlocale():

You can follow this issue (and test a patch) here.

Hello @ctgraham,

I replaced the contents of plugins/reports/counter/CounterReportPlugin.inc.php with the contents of the file in Github.

Nothing changed.

The patch is actually this change:

The file CounterReportPlugin.inc.php remains unchanged.

Hello ctgraham,

That just produced more messages of the type;

The locale file “” is missing or unreadable. CREATE
The locale file “” is missing or unreadable. CREATE
The locale file “” is missing or unreadable. CREATE
The locale file “” is missing or unreadable. CREATE
The locale file “” is missing or unreadable. CREATE

I have abou 50 of those on the translator’s check screen…

I would be interested in reproducing this.

Your current version is OJS 2.4.8, correct?

What locale are you checking?

Hello @ctgraham,

Checking Portuguese Brazilian on a patched version
VERSION: 2.4.8.0; MAJOR: 2; MINOR: 4; REVISION: 8; BUILD: 0; DATE INSTALLED: 16/02/2016
VERSION: 2.4.7.1; MAJOR: 2; MINOR: 4; REVISION: 7; BUILD: 1; DATE INSTALLED: 17/11/2015.

The multiple error messages also appear on the Spanish (Spain) and English (en_US) translation. Our journal’s interface is now trilingual…

It sounds like you are running the “check” action on the es_ES (Spanish) and en_US (English) locales. I’m not aware of a way to run the “check” action on the en_US locale, as it should always be the reference locale, even when another locale is the primary locale for the site.

Is pt_BR your primary locale? Does your Translate plugin look like this?

Hello @ctgraham,

Yes it does.
But the check link appears on all languages when you click the Edit action link… even in the en_US locale…

Got it. I found the “check” link for en_US in the Edit action.

I was not able to replicate the error messages however. My process was:

git clone https://github.com/pkp/ojs
cd ojs
git checkout ojs-stable-2_4_8
git submodule update --init --recursive
git remote add ulsdevteam https://github.com/ulsdevteam/ojs
git fetch ulsdevteam
git cherry-pick d20acd04ac0eb162c0e05aa4935bcba2ccf180f5

I then did a quick install with a single journal, pt_BR as the primary locale and es_ES and en_US as alternate locales.

When I use the “check” locale against es_ES or en_US or pt_BR, I don’t see any of the messages:

The locale file “” is missing or unreadable. CREATE

Can you reproduce this error in a clean install from your end?

Hello @ctgraham,

I was afraid you’d say that… Can’t use github here…

I’m going to restore my backup and proceed to a full-download upgrade procedure.

It seems the only/safest way to guarantee that the upgrade won’t fail. It just causes lots of rework and excessive documentation on what has been customized.

The full package download would be a good way forward, even for just a test.

If you can’t use Github, could you still use Git, subversion, or mercurial locally for revision control? It greatly simplifies the management of custom changes.

Hi @ctgraham,

Unfortunately, I have very little experience using those tools… I wouldn’t even know how to get started…

Hello @ctgraham,

I downloaded a fresh 2.4.8 and applied the Translator patch.
Now, the error messages are gone and the missing files messages are ok:

Missing Locale Files
The locale file “plugins/metadata/dc11/locale/pt_BR/locale.xml” is missing or unreadable. CREATE
The locale file “plugins/reports/counter/locale/pt_BR/ar1.xml” is missing or unreadable. CREATE
The locale file “plugins/reports/counter/locale/pt_BR/jr1.xml” is missing or unreadable. CREATE

Now, I’ll have to redo all my custom code…