Some pages with error after upgrade from 3.3.0.14 to 3.4.0-5 related to locales

Describe the issue or problem
The following error occurs when an article is viewed in :

Fatal error : Uncaught Error: Call to a member function getDisplayName() on null in /var/www/ojs3/lib/pkp/classes/i18n/Locale.php:279 Stack trace: #0 [internal function]: PKP\i18n\Locale->PKP\i18n{closure}() #1 /var/www/ojs3/lib/pkp/classes/i18n/Locale.php(279): array_map() #2 /var/www/ojs3/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): PKP\i18n\Locale->getSupportedLocales() #3 /var/www/ojs3/plugins/generic/citationStyleLanguage/CitationStyleLanguagePlugin.php(421): Illuminate\Support\Facades\Facade::__callStatic() #4

/var/www/ojs3/plugins/generic/citationStyleLanguage/CitationStyleLanguagePlugin.php(332): APP\plugins\generic\citationStyleLanguage\CitationStyleLanguagePlugin->getCitation() #5 [internal function]: APP\plugins\generic\citationStyleLanguage\CitationStyleLanguagePlugin->getTemplateData() #6 /var/www/ojs3/lib/pkp/classes/plugins/Hook.php(139): call_user_func_array() #7 /var/www/ojs3/lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run() #8 /var/www/ojs3/pages/article/ArticleHandler.php(354): PKP\plugins\Hook::call() #9 [internal function]: APP\pages\article\ArticleHandler->view() #10 /var/www/ojs3/lib/pkp/classes/core/PKPRouter.php(334): call_user_func() #11 /var/www/ojs3/lib/pkp/classes/core/PKPPageRouter.php(277): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest() #12 /var/www/ojs3/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route() #13 /var/www/ojs3/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch() #14 /var/www/ojs3/index.php(20): PKP\core\PKPApplication->execute() #15 {main} thrown in /var/www/ojs3/lib/pkp/classes/i18n/Locale.php on line 279

When i try to access the plugin tab and other forms the spin keep loading forever. The error is below:

Fatal error : Uncaught Error: Call to a member function getDisplayName() on null in /var/www/ojs3/lib/pkp/classes/i18n/Locale.php:279 Stack trace: #0 [internal function]: PKP\i18n\Locale->PKP\i18n{closure}() #1 /var/www/ojs3/lib/pkp/classes/i18n/Locale.php(279): array_map() #2 /var/www/ojs3/lib/pkp/classes/i18n/Locale.php(271): PKP\i18n\Locale->getSupportedLocales() #3 /var/www/ojs3/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): PKP\i18n\Locale->getSupportedFormLocales() #4

/var/www/ojs3/lib/pkp/classes/controllers/grid/GridCellProvider.php(68): Illuminate\Support\Facades\Facade::__callStatic() #5 /var/www/ojs3/lib/pkp/classes/controllers/grid/GridHandler.php(1262): PKP\controllers\grid\GridCellProvider->render() #6 /var/www/ojs3/lib/pkp/classes/controllers/grid/GridHandler.php(1163): PKP\controllers\grid\GridHandler->_renderCellInternally() #7 /var/www/ojs3/lib/pkp/classes/controllers/grid/GridHandler.php(1138): PKP\controllers\grid\GridHandler->renderRowInternally() #8 /var/www/ojs3/lib/pkp/classes/controllers/grid/GridHandler.php(1188): PKP\controllers\grid\GridHandler->renderRowsInternally() #9 /var/www/ojs3/lib/pkp/classes/controllers/grid/GridHandler.php(1063): PKP\controllers\grid\GridHandler->renderGridBodyPartsInternally() #10 /var/www/ojs3/lib/pkp/classes/controllers/grid/GridHandler.php(735): PKP\controllers\grid\GridHandler->doSpecificFetchGridActions() #11 [internal function]: PKP\controllers\grid\GridHandler->fetchGrid() #12 /var/www/ojs3/lib/pkp/classes/core/PKPRouter.php(334): call_user_func() #13 /var/www/ojs3/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest() #14 /var/www/ojs3/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route() #15 /var/www/ojs3/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch() #16 /var/www/ojs3/index.php(20): PKP\core\PKPApplication->execute() #17 {main} thrown in /var/www/ojs3/lib/pkp/classes/i18n/Locale.php on line 279

The error is the same but from different origins.
In an article page the error came from the CitationStyleLanguagePlugin.
The error from plugins tab came from getSupportedFormLocales().
Both of them uses the PKP\i18n\Locale->getSupportedLocales().

Steps I took leading up to the issue

  1. Go to an journal and view an article or go to plugin tabs or other forms of site administration page
  2. See error

What application are you using?
OJS 3.4.0-5

Additional information
We have journals that this error occurs and other not. All journal pages can be viewed. But, in a journal, or all the articles render or none of them render. Example: An journal J1 have X articles and all of X articles render normally but another journal J2 have Y articles however none of Y articles render with this error.

The error on plugins tab and other forms always occurs.

Thank you in advance for the attention and patience.

Hi Douglas,

To start, can you please run these queries on your database, and let me know the results?

select installed_locales, supported_locales from site;

select distinct primary_locale from journals;

select distinct setting_value
from journal_settings js
where setting_name in ('supportedSubmissionLocales', 'supportedLocales', 'supportedFormLocales');

These will shed some light to the question.

select installed_locales, supported_locales from site;

select distinct primary_locale from journals;

select distinct setting_value
from journal_settings js
where setting_name in ('supportedSubmissionLocales', 'supportedLocales', 'supportedFormLocales');

The results of the queries are bellow.

select installed_locales, supported_locales from site;

installed_locales supported_locales
[en,pt_BR,es,es_AR,fr_CA,fr_FR,pt_PT] [en,pt_BR,es,es_AR,fr_FR]
[en,pt_BR,es,es_AR,fr_CA,fr_FR,pt_PT] [en,pt_BR,es,es_AR,fr_FR]
[en,pt_BR,es,es_AR,fr_CA,fr_FR,pt_PT] [en,pt_BR,es,es_AR,fr_FR]
[en,pt_BR,es,es_AR,fr_CA,fr_FR,pt_PT] [en,pt_BR,es,es_AR,fr_FR]
[en,pt_BR,es,es_AR,fr_CA,fr_FR,pt_PT] [en,pt_BR,es,es_AR,fr_FR]
[en,pt_BR,es,es_AR,fr_CA,fr_FR,pt_PT] [en,pt_BR,es,es_AR,fr_FR]

select distinct primary_locale from journals;

primary_locale
pt_BR
en

select distinct setting_value
from journal_settings js
where setting_name in (‘supportedSubmissionLocales’, ‘supportedLocales’, ‘supportedFormLocales’);

setting_value
[“pt_BR”]
[“en”,“pt_BR”,“es”]
[“en”]
[“en”,“pt_BR”,“es”,“es_AR”,“fr_FR”]
[“en”,“es”,“pt_BR”]
[“pt_BR”,“en”,“es”]
[“pt_BR”,“es”,“en”]
[“pt_BR”,“en”,“es”,“es_AR”,“fr_FR”]
[“en”,“es_AR”,“es”,“fr_FR”,“pt_BR”]
[“pt_BR”,“es_AR”]
[“pt_BR”,“en”]
[“pt_BR”,“es_AR”,“en”]