My test server had warnings turned on and I saw a lot of these in the logs:
[Wed Jan 24 17:59:30.930864 2018] [:error] [pid 27808] [client 10.8.0.10:50544] PHP Warning: array_flip(): Can only flip STRING and INTEGER values! in /var/www/site.fi/public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 702, referer: https://site.fi/context/management/settings/publication
[Wed Jan 24 17:59:30.690876 2018] [:error] [pid 27808] [client 10.8.0.10:50544] , referer: https://site.fi/context/management/settings/publication
[Wed Jan 24 17:59:30.690902 2018] [:error] [pid 27808] [client 10.8.0.10:50544] EmailTemplate Object\n(\n [_data] => Array\n (\n [emailKey] => CITATION_EDITOR_AUTHOR_QUERY\n [locale] => fi_FI\n [subject] => Viittausten muokkaus\n [body] => Hyv\xc3\xa4 {$authorFirstName},<br />\n<br />\nVoisitteko yst\xc3\xa4v\xc3\xa4llisesti vahvistaa seuraavan artikkelissanne {$submissionTitle} olevan l\xc3\xa4hdeviitteen tai antaa oikean viittauksen:<br />\n<br />\n{$rawCitation}<br />\n<br />\nKiitos!<br />\n<br />\n{$userFirstName}<br />\nTekninen toimittaja, {$contextName}<br />\n\n [enabled] => 1\n [canDisable] => 0\n )\n\n [_hasLoadableAdapters] => \n [_metadataExtractionAdapters] => Array\n (\n )\n\n [_extractionAdaptersLoaded] => \n [_metadataInjectionAdapters] => Array\n (\n )\n\n [_injectionAdaptersLoaded] => \n [isCustomTemplate] => \n)\n, referer: https://site.fi/context/management/settings/publication
[Wed Jan 24 17:59:30.690919 2018] [:error] [pid 27808] [client 10.8.0.10:50544] PHP Warning: array_flip(): Can only flip STRING and INTEGER values! in /var/www/site.fi/public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 702, referer: https://site.fi/context/management/settings/publication
[Wed Jan 24 17:59:30.713642 2018] [:error] [pid 27808] [client 10.8.0.10:50544] 512, referer: https://site.fi/context/management/settings/publication
[Wed Jan 24 17:59:30.713679 2018] [:error] [pid 27808] [client 10.8.0.10:50544] EmailTemplate Object\n(\n [_data] => Array\n (\n [emailKey] => COPYEDIT_REQUEST\n [locale] => fi_FI\n [subject] => Teknist\xc3\xa4 toimittamista pyydet\xc3\xa4\xc3\xa4n\n [body] => Hyv\xc3\xa4 {$participantName},<br />\n<br />\nPyyt\xc3\xa4isin teit\xc3\xa4 toimittamaan teknisesti k\xc3\xa4sikirjoituksen "{$submissionTitle}" julkaisulle {$contextName}, seuraavia vaiheita noudattaen:<br />\n1. Klikatkaa alla olevaa k\xc3\xa4sikirjoituksen URL-osoitetta.<br />\n2. Avatkaa Luonnostiedostot-otsikon alla olevat tiedostot ja toimittakaa ne teknisesti. Voitte samalla lis\xc3\xa4t\xc3\xa4 tekniseen toimittamiseen liittyvi\xc3\xa4 keskusteluja tarpeen mukaan.<br />\n3. Tallentakaa teknisesti toimitetut tiedostot ja ladatkaa ne Teknisesti toimitettu -paneeliin.<br />\n4. Ilmoittakaa toimittajalle, ett\xc3\xa4 kaikki tiedostot ovat valmiina, ja ett\xc3\xa4 tuotantoprosessi voidaan aloittaa.<br />\n<br />\n{$contextName} URL: {$contextUrl}<br />\nK\xc3\xa4sikirjoituksen URL: <a href="{$submissionUrl}">{$submissionUrl}</a><br />\nK\xc3\xa4ytt\xc3\xa4j\xc3\xa4tunnus: {$participantUsername}<br />\n<br />\nYst\xc3\xa4v\xc3\xa4llisin terveisin,<br />\n{$editorialContactSignature}\n [enabled] => 1\n [canDisable] => 1\n [fromRoleId] => 512\n [toRoleId] => 8192\n )\n\n [_hasLoadableAdapters] => \n [_metadataExtractionAdapters] => Array\n (\n )\n\n [_extractionAdaptersLoaded] => \n [_metadataInjectionAdapters] => Array\n (\n )\n\n [_injectionAdaptersLoaded] => \n [isCustomTemplate] => \n)\n, referer: https://site.fi/context/management/settings/publication
Basically the CITATION_EDITOR_AUTHOR_QUERY template does not return roleid (that is the first empty error line there), but for example the COPYEDIT_REQUEST template returns 512.
Edit: and in the PreparedEmailsGridProvider I am doing this:
diff --git a/controllers/grid/settings/preparedEmails/PreparedEmailsGridCellProvider.inc.php b/controllers/grid/settings/preparedEmails/PreparedEmailsGridCellProvider.inc.php
index 4649289..322880b 100644
--- a/controllers/grid/settings/preparedEmails/PreparedEmailsGridCellProvider.inc.php
+++ b/controllers/grid/settings/preparedEmails/PreparedEmailsGridCellProvider.inc.php
@@ -35,6 +35,7 @@ class PreparedEmailsGridCellProvider extends DataObjectGridCellProvider {
return array('label' => ucwords(strtolower(str_replace('_', ' ', $label))));
case 'sender':
$roleId = $element->getFromRoleId();
+ if (!$roleId) return array('label' => '');
$label = Application::getRoleNames(false, array($roleId));
return array('label' => __(array_shift($label)));
case 'recipient':
I think this addition should take care of it. The warning is cosmetic, and it’s on a purely informational part of the code, but’ll be better to keep it out of the log.
Regards,
Alec Smecher
Public Knowledge Project Team