glpi icon indicating copy to clipboard operation
glpi copied to clipboard

GLPI 11 - unable to list plugins (without marketplace)

Open TheRoby opened this issue 1 year ago • 10 comments

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [x] I have searched the existing issues

Version

11.0.0-dev (nightly)

Bug description

I cloned my test server to migrate it to GLPI 11, so I can start testing. The migration seems to have gone well, but when I want to reactivate the plugins, I have an error :

Compile Error: Declaration of PluginPdfConfig::canCreate() must be compatible with CommonGLPI::canCreate(): bool
In /var/www/glpi/plugins/pdf/inc/config.class.php(39)
#0 {main}

My server does not have internet access. So I do not use the marketplace.

if I click on marketplace I have the list of plugins (and a message to say that I don't have internet) and it is indicated that the majority of plugins are not compatible with GLPI 11 ;)

Image

Relevant log output


Page URL

/front/plugin.php

Steps To reproduce

  1. have v10 plugins in the plugins directory
  2. go to configuration / plugins

Your GLPI setup information

No response

Anything else?

thank you :)

TheRoby avatar Jan 09 '25 15:01 TheRoby

GLPI 11 is currently in alpha, most of plugins are not compatible; this is not a GLPI issue.

trasher avatar Jan 09 '25 17:01 trasher

Maybe I misunderstood the issue... Compatible or not; plugins are correctly listed from marketplace view, but not legacy one. So I reopen.

But anyway, you can use marketplace directory/view without an internet access, a warning is indeed displayed but you should be able to manage your plugins this way.

In the future, the legacy UI will certainly be removed.

trasher avatar Jan 09 '25 17:01 trasher

In the future, the legacy UI will certainly be removed.

I thought the original UI was staying. GLPI 11 adds the ability to block the marketplace. If the current UI gets removed, I think the marketplace UI will need to be able to work in an offline mode where it only shows the present plugins without fetching anything from an external server.

cconard96 avatar Jan 09 '25 17:01 cconard96

Since the legacy UI use specific code, this is more leagacy code to maintain, and we try to avoid that. That's currently not deprecated. Anyway, that should continue working, and it's currently indeed broken on v11.

trasher avatar Jan 09 '25 17:01 trasher

Maybe I misunderstood the issue... Compatible or not; plugins are correctly listed from marketplace view, but not legacy one. So I reopen.

But anyway, you can use marketplace directory/view without an internet access, a warning is indeed displayed but you should be able to manage your plugins this way.

In the future, the legacy UI will certainly be removed.

Hi, Are you interested in bug reports on GLPI v11 or is it too early? (menu not working when minimized, printer page counters not displaying anything) Thanks again :)

TheRoby avatar Jan 10 '25 07:01 TheRoby

Yes, you can report issues on GLPI 11, just ensure you're using a recent nightly build (the latest one if possible).

Thanks!

trasher avatar Jan 10 '25 08:01 trasher

The problem can also be reproduced this way :

  • download the pdf plugin in plugins directory
  • install the plugin in terminal ./bin/console plugin:install pdf
  • change the requirements in plugin code
  • mark the plugin activated in database (state = 1)

I'm working to prevent this.

SebSept avatar Jan 15 '25 13:01 SebSept

@TheRoby have you made changes in your plugin code ? can you tell us what is the current state of the plugin in database (glpi_plugins table) ?

SebSept avatar Jan 15 '25 14:01 SebSept

No, I didn't touch the code Now, I have all the plugins that I use with my GLPI 10 :

Image

TheRoby avatar Jan 15 '25 14:01 TheRoby

Thanks for the feedback.

We are dealing with the topic of error handling. Discussions are ongoing. ( #18765 )

Specifically for your problem, you need to modify the plugin code to comply with the CommonDBTM class whose signatures have evolved in version 11. For the presented error, add the return type.

static function canCreate(): bool
   {
      return Session::haveRight('config', UPDATE);
   }

I don't know if the bug should be closed or renamed with a more generic title...

SebSept avatar Jan 20 '25 10:01 SebSept