Code of Conduct
Is there an existing issue for this?
GLPI Version
11.0.6
Plugin version
1.23.3
Bug description
Hello,
When looking on my php error log, I get this error :
glpi.WARNING: *** User Warning: MySQL query warnings:
SQL: SELECT * FROM glpi_plugin_fields_containers WHERE is_active = '1' AND type = 'dom' AND ((itemtypes LIKE '%\"Ticket\"%') OR (itemtypes LIKE '%\"Change\"%') OR (itemtypes LIKE '%\"Problem\"%')) AND (glpi_plugin_fields_containers.entities_id = '') ORDER BY name
Warnings:
1292: Truncated incorrect DECIMAL value: '' at DBmysql.php line 444
Backtrace :
./src/DBmysql.php:444
./src/DBmysqlIterator.php:129 DBmysql->doQuery()
./src/DBmysql.php:1088 DBmysqlIterator->execute()
./src/CommonDBTM.php:632 DBmysql->request()
...rketplace/fields/inc/questiontype.class.php:332 CommonDBTM->find()
...rketplace/fields/inc/questiontype.class.php:374 PluginFieldsQuestionType->getAvailableBlocks()
./marketplace/fields/setup.php:428 PluginFieldsQuestionType::hasAvailableFields()
./marketplace/fields/setup.php:133 plugin_fields_register_plugin_types()
./src/Plugin.php:475 plugin_init_fields()
./src/Plugin.php:428 Plugin::load()
...tener/PostBootListener/InitializePlugins.php:75 Plugin->init()
...ymfony/event-dispatcher/EventDispatcher.php:260 Glpi\Kernel\Listener\PostBootListener\InitializePlugins->onPostBoot()
...ymfony/event-dispatcher/EventDispatcher.php:220 Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher{closure}()
...symfony/event-dispatcher/EventDispatcher.php:56 Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
./src/Glpi/Kernel/Kernel.php:149 Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
./vendor/symfony/http-kernel/Kernel.php:201 Glpi\Kernel\Kernel->boot()
./public/index.php:71 Symfony\Component\HttpKernel\Kernel->handle()
IT seems the entity get wrong values.
Relevant log output
glpi.WARNING: *** User Warning: MySQL query warnings:
SQL: SELECT * FROM `glpi_plugin_fields_containers` WHERE `is_active` = '1' AND `type` = 'dom' AND ((`itemtypes` LIKE '%\\\"Ticket\\\"%') OR (`itemtypes` LIKE '%\\\"Change\\\"%') OR (`itemtypes` LIKE '%\\\"Problem\\\"%')) AND (`glpi_plugin_fields_containers`.`entities_id` = '') ORDER BY `name`
Warnings:
1292: Truncated incorrect DECIMAL value: '' at DBmysql.php line 444
Backtrace :
./src/DBmysql.php:444
./src/DBmysqlIterator.php:129 DBmysql->doQuery()
./src/DBmysql.php:1088 DBmysqlIterator->execute()
./src/CommonDBTM.php:632 DBmysql->request()
...rketplace/fields/inc/questiontype.class.php:332 CommonDBTM->find()
...rketplace/fields/inc/questiontype.class.php:374 PluginFieldsQuestionType->getAvailableBlocks()
./marketplace/fields/setup.php:428 PluginFieldsQuestionType::hasAvailableFields()
./marketplace/fields/setup.php:133 plugin_fields_register_plugin_types()
./src/Plugin.php:475 plugin_init_fields()
./src/Plugin.php:428 Plugin::load()
...tener/PostBootListener/InitializePlugins.php:75 Plugin->init()
...ymfony/event-dispatcher/EventDispatcher.php:260 Glpi\Kernel\Listener\PostBootListener\InitializePlugins->onPostBoot()
...ymfony/event-dispatcher/EventDispatcher.php:220 Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
...symfony/event-dispatcher/EventDispatcher.php:56 Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
./src/Glpi/Kernel/Kernel.php:149 Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
./vendor/symfony/http-kernel/Kernel.php:201 Glpi\Kernel\Kernel->boot()
./public/index.php:71 Symfony\Component\HttpKernel\Kernel->handle()
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
No response
Anything else?
Fixed by editing line 331 of questiontype.class.php : from $entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true); to
$entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', 0, true);
Code of Conduct
Is there an existing issue for this?
GLPI Version
11.0.6
Plugin version
1.23.3
Bug description
Hello,
When looking on my php error log, I get this error :
glpi.WARNING: *** User Warning: MySQL query warnings:
SQL: SELECT * FROM
glpi_plugin_fields_containersWHEREis_active= '1' ANDtype= 'dom' AND ((itemtypesLIKE '%\"Ticket\"%') OR (itemtypesLIKE '%\"Change\"%') OR (itemtypesLIKE '%\"Problem\"%')) AND (glpi_plugin_fields_containers.entities_id= '') ORDER BYnameWarnings:
1292: Truncated incorrect DECIMAL value: '' at DBmysql.php line 444
Backtrace :
./src/DBmysql.php:444
./src/DBmysqlIterator.php:129 DBmysql->doQuery()
./src/DBmysql.php:1088 DBmysqlIterator->execute()
./src/CommonDBTM.php:632 DBmysql->request()
...rketplace/fields/inc/questiontype.class.php:332 CommonDBTM->find()
...rketplace/fields/inc/questiontype.class.php:374 PluginFieldsQuestionType->getAvailableBlocks()
./marketplace/fields/setup.php:428 PluginFieldsQuestionType::hasAvailableFields()
./marketplace/fields/setup.php:133 plugin_fields_register_plugin_types()
./src/Plugin.php:475 plugin_init_fields()
./src/Plugin.php:428 Plugin::load()
...tener/PostBootListener/InitializePlugins.php:75 Plugin->init()
...ymfony/event-dispatcher/EventDispatcher.php:260 Glpi\Kernel\Listener\PostBootListener\InitializePlugins->onPostBoot()
...ymfony/event-dispatcher/EventDispatcher.php:220 Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher{closure}()
...symfony/event-dispatcher/EventDispatcher.php:56 Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
./src/Glpi/Kernel/Kernel.php:149 Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
./vendor/symfony/http-kernel/Kernel.php:201 Glpi\Kernel\Kernel->boot()
./public/index.php:71 Symfony\Component\HttpKernel\Kernel->handle()
IT seems the entity get wrong values.
Relevant log output
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
No response
Anything else?
Fixed by editing line 331 of questiontype.class.php : from $entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true); to
$entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', 0, true);