ericferon / glpi-archisw

GLPI plugin for application inventory
GNU General Public License v2.0
8 stars 5 forks source link

Uncaught Exception Error: Call to undefined method PluginWebapplicationsWebapplication::registerType() #43

Closed jcervantes-sipecom closed 3 years ago

jcervantes-sipecom commented 3 years ago

Hi, I already install the plugin but I'm getting the followin error on Debug mode when trying to Activate it:

Uncaught Exception Error: Call to undefined method PluginWebapplicationsWebapplication::registerType() in /usr/share/g952/archisw/setup.php at line 63

My GLPI is for testing: GLPI 9.5.2 Plugin version: v2.2.1 SO: Ubuntu 20.04.1 LTS

Also, I'm using the Filesystem Hirerarchie Standard for Ubuntu:

https://glpi-developer-documentation.readthedocs.io/en/master/packaging.html https://glpi-install.readthedocs.io/en/latest/install/index.html#files-and-directories-locations

ericferon commented 3 years ago

You probably didn't install the Webapplication plugin. There is no impact on the plugin functionality, normally. K.r,

jcervantes-sipecom commented 3 years ago

Hi Yes, but this error avoids the plugins page load, if it was not in debug mode, the error could not be displayed, the page is completely blank.

Also the Webapplication plugin is installed and active: image

I had to move the archisw folder to another location to be able to load the plugins page and once I verified the Webapplication plugin is installed and activated, I moved the archisw folder back to the plugins folder. But the error persist:

image

If the Webapplications plugin is necessary then it should be added in the setup.php which is required, like this:

'requirements' => [ 'glpi' => [ 'min' => '9.5', 'dev' => false, 'plugins' => [ 'webapplications', ],

Additionally, on line 63 specify that the Webapplications plugin must be activated. I solved it like this:

$ plugin = new Plugin (); if (class_exists ($itemtype) && $plugin-> isActivated ($ itemtype)) {

Attach my setup.php (setup.php.txt)

In this way I could load the plugin page when:

ericferon commented 3 years ago

In fact, the plugin Webapplication is now integrated into GLPI core, as appliance. So, the "registerType" method doesn't exist anymore for Webapplication. In order to avoid the error message, you should modify the line 58 into a comment : // 'PluginWebapplicationsWebapplication', Can you confirm that this is a solution for you ? I will then release a new version of the plugin. Thank you for your contribution,

jcervantes-sipecom commented 3 years ago

Yes, the problem doesn't show it anymore when installing the plugin.