pluginsGLPI / geninventorynumber

Inventorynumber generation
GNU General Public License v3.0
8 stars 14 forks source link

update to 2.8.4 fails with `ArgumentCountError` in `DBmysql::update()` #89

Closed silhusk closed 2 months ago

silhusk commented 3 months ago

Plugin update from 2.8.3 to 2.8.4 in Glpi 10.0.15 fails with the following error:

[2024-05-22 15:10:32] glpiphplog.CRITICAL:   *** Uncaught Exception ArgumentCountError: Too few arguments to function DBmysql::update(), 2 passed in /var/www/glpi/marketplace/geninventorynumber/inc/configfield.class.php on line 124 and at least 3 expected in /var/www/glpi/src/DBmysql.php at line 1500
  Backtrace :
  ...eninventorynumber/inc/configfield.class.php:124 DBmysql->update()
  marketplace/geninventorynumber/hook.php:80         PluginGeninventorynumberConfigField::install()
  src/Plugin.php:922                                 plugin_geninventorynumber_install()
  :                                                  Plugin->install()
  src/Marketplace/Controller.php:546                 call_user_func()
  src/Marketplace/Controller.php:436                 Glpi\Marketplace\Controller->setPluginState()
  src/Marketplace/Controller.php:179                 Glpi\Marketplace\Controller->installPlugin()
  ajax/marketplace.php:75                            Glpi\Marketplace\Controller->downloadPlugin()
  public/index.php:82                                require()
Gibraltar75 commented 3 months ago

Hi,

Having the same problem. Update GLPI from v10.0.10 to v10.0.15 and plugin when updated from v2.8.3 to v.2.8.4 get:

Uncaught Exception ArgumentCountError: Too few arguments to function DBmysql::update(), 2 passed in /var/www/html/glpi/marketplace/geninventorynumber/inc/configfield.class.php on line 124 and at least 3 expected in /var/www/html/glpi/src/DBmysql.php at line 1500

jcervantes-sipecom commented 3 months ago

Me too

blackbasket commented 3 months ago

same here...

Elric59 commented 3 months ago

Hello :)

In configfield.class.php, line 124, change query update by

$DB->update($cfield::getTable(), [ 'date_last_generated' => $max ], ['id' => $cfield->getID()]);

Normally, there will be no errors left after this.

romnvll commented 3 months ago

Merci pour la solution !

Rom1-B commented 2 months ago

Fixed in latest release: 2.8.5