Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins list empty after update to 9.4.0 #5409

Closed
humboldtux opened this issue Feb 19, 2019 · 8 comments
Closed

Plugins list empty after update to 9.4.0 #5409

humboldtux opened this issue Feb 19, 2019 · 8 comments
Assignees
Milestone

Comments

@humboldtux
Copy link

Describe the bug

Since updating from GLPI 9.3.3 to 9.4.0, the plugins list is empty, no plugin is shown. I've to manually find same through the new search bar of the plugin page to show them one by one in front/plugin.php.

To reproduce

  1. Update to 9.4.0
  2. Go to front/plugin.php
  3. No plugin is shown

Expected behavior

All plugins (enable and disable) should be listed by default

Screenshots

Empty list by default:

plugin

Listing a plugin via the new search bar:

plugins

@cedric-anne
Copy link
Member

Hi,

Seems that the page is not fully loaded. Could tou check your logs in files/_log and tell us if you have something that can help us ?

Regards

@OscarBeiro
Copy link
Contributor

Hi,

I hadn't tested plugins area before and reproduced the same behavior.

This seems related to some plugins actions. I've detected at least 3:

This is for Diagrams (archimap) plugin:

Fatal error: Uncaught Error: Call to undefined function _e() in /usr/share/glpi/plugins/archimap/setup.php:95 Stack trace: #0 /usr/share/glpi/inc/plugin.class.php(1974): plugin_archimap_check_prerequisites() #1 /usr/share/glpi/inc/search.class.php(6184): Plugin::getSpecificValueToDisplay('id', Array, Array) #2 /usr/share/glpi/inc/search.class.php(1428): Search::giveItem('Plugin', 'Plugin_8', Array) #3 /usr/share/glpi/inc/search.class.php(98): Search::constructData(Array) #4 /usr/share/glpi/inc/search.class.php(80): Search::showList('Plugin', Array) #5 /usr/share/glpi/front/plugin.php(44): Search::show('Plugin') #6 {main} thrown in /usr/share/glpi/plugins/archimap/setup.php on line 95


 89       $query="ALTER TABLE `glpi_plugin_archimap_profiles`
 90                DROP `name` ;";
 91       $result=$DB->query($query);
 92
 93       Plugin::migrateItemType(
 94          array(2400=>'PluginArchimapGraph'),
 95          array("glpi_bookmarks", "glpi_bookmarks_users", "glpi_displaypreferences",
 96                "glpi_documents_items", "glpi_infocoms", "glpi_logs", "glpi_items_tickets"),
 97          array("glpi_plugin_archimap_graphs_items"));
 98
 99       Plugin::migrateItemType(
100          array(1200 => "PluginAppliancesAppliance",1300 => "PluginWebapplicationsWebapplication"),
101          array("glpi_plugin_archimap_graphs_items"));
102    }

This is for domains plugin

Fatal error: Uncaught Error: Class 'PluginDomainsDomain' not found in /usr/share/glpi/plugins/domains/hook.php:508 Stack trace: #0 /usr/share/glpi/inc/plugin.class.php(1115): plugin_domains_MassiveActions('Plugin') #1 /usr/share/glpi/inc/massiveaction.class.php(577): Plugin::doOneHook('domains', 'plugin_domains_...', 'Plugin') #2 /usr/share/glpi/inc/search.class.php(1587): MassiveAction::getAllMassiveActions(Object(Plugin), 0) #3 /usr/share/glpi/inc/search.class.php(99): Search::displayData(Array) #4 /usr/share/glpi/inc/search.class.php(80): Search::showList('Plugin', Array) #5 /usr/share/glpi/front/plugin.php(44): Search::show('Plugin') #6 {main} thrown in /usr/share/glpi/plugins/domains/hook.php on line 508

499 ////// SPECIFIC MODIF MASSIVE FUNCTIONS ///////
500
501 /**
502  * @param $type
503  *
504  * @return array
505  */
506 function plugin_domains_MassiveActions($type) {
507
508    if (in_array($type, PluginDomainsDomain::getTypes(true))) {
509       return ['PluginDomainsDomain' . MassiveAction::CLASS_ACTION_SEPARATOR . 'plugin_domains_add_item' =>
510                       __('Associate a domain', 'domains')];
511    }
512    return [];
513 }

This is for accounts plugin

Fatal error: Uncaught Error: Class 'PluginAccountsAccount' not found in /usr/share/glpi/plugins/accounts/hook.php:777 Stack trace: #0 /usr/share/glpi/inc/plugin.class.php(1115): plugin_accounts_MassiveActions('Plugin') #1 /usr/share/glpi/inc/massiveaction.class.php(577): Plugin::doOneHook('accounts', 'plugin_accounts...', 'Plugin') #2 /usr/share/glpi/inc/search.class.php(1587): MassiveAction::getAllMassiveActions(Object(Plugin), 0) #3 /usr/share/glpi/inc/search.class.php(99): Search::displayData(Array) #4 /usr/share/glpi/inc/search.class.php(80): Search::showList('Plugin', Array) #5 /usr/share/glpi/front/plugin.php(44): Search::show('Plugin') #6 {main} thrown in /usr/share/glpi/plugins/accounts/hook.php on line 777

768 ////// SPECIFIC MODIF MASSIVE FUNCTIONS ///////
769
770 /**
771  * @param $type
772  *
773  * @return array
774  */
775 function plugin_accounts_MassiveActions($type) {
776
777    if (in_array($type, PluginAccountsAccount::getTypes(true))) {
778       return [
779          'PluginAccountsAccount' . MassiveAction::CLASS_ACTION_SEPARATOR . "add_item" => __('Associate to account', 'accounts')
780       ];
781    }
782    return [];
783 }

Teclib's and TICgal's tested plugins are not affected

@cedric-anne
Copy link
Member

_e() was deprecated since 9.2

For calls on _MassiveActions(, looks like we may filter calls to do it only on loaded plugins, as autoload is not loading class for not active plugins.

@cedric-anne
Copy link
Member

@OscarBeiro,

Can you try this fix: #5413 ?

Regards

@OscarBeiro
Copy link
Contributor

It works.
Thanks @cedric-anne !

@sebelk
Copy link

sebelk commented Mar 8, 2019

I've tried replacing the file using https://raw.githubusercontent.com/cedric-anne/glpi/923cac5711120d7ab40f0de8e2a8422fb53fa7b4/inc/plugin.class.php and does not work for me using 9.4.0.

the error is:

Fatal error: Call to undefined function _e() in /var/www/html/plugins/resources/setup.php on line 183

@cedric-anne
Copy link
Member

Hi

Error is in resource , not in GLPI itself.

Regards

@sebelk
Copy link

sebelk commented Mar 8, 2019

Ooops, shame on me, nevermind.

ettalhi pushed a commit to ettalhi/glpi that referenced this issue Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants