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

Warning: Invalid relations declared between "glpi_printers" and "glpi_plugin_printercounters_items_billingmodels" on GLPI 10.0.7 #92

Open
ftoledo opened this issue Apr 12, 2023 · 4 comments

Comments

@ftoledo
Copy link

ftoledo commented Apr 12, 2023

hi all!
i just update to glpi 10.0.7 and get this warning message

PHP Warning:  Invalid relations declared between "glpi_printers" and "glpi_plugin_printercounters_items_billingmodels" table. Target field "items_id" is not a foreign key field. in //html/src/DbUtils.php on line 2144
PHP Stack trace:
PHP   1. {main}() //html/front/cron.php:0
PHP   2. CronTask::launch($mode = 2, $max = '5', $name = *uninitialized*) //html/front/cron.php:83
PHP   3. PluginGlpiinventoryTaskjobstate::cronCleantaskjob(class CronTask { public $dohistory = TRUE; private $timer = 1681297201.6635; private $startlog = 5482423; private $volume = 0; public $fields = ['date_creation' => '2018-07-14 01:12:16', 'date_mod' => '2018-07-14 01:12:16', 'id' => 49, 'itemtype' => 'PluginGlpiinventoryTaskjobstate', 'name' => 'cleantaskjob', 'frequency' => 86400, 'param' => NULL, 'state' => 1, 'mode' => 2, 'allowmode' => 3, 'hourmin' => 0, 'hourmax' => 24, 'logs_lifetime' => 30, 'lastrun' => '2023-04-11 08:00:00', 'lastcode' => NULL, 'comment' => NULL, 'ISPLUGIN' => 1]; public $input = []; public $updates = []; public $oldvalues = []; public $history_blacklist = []; public $auto_message_on_action = TRUE; public $no_form_page = FALSE; public $additional_fields_for_dictionnary = []; protected $fkfield = ''; protected $searchopt = FALSE; public $taborientation = 'vertical'; public $get_item_to_display_tab = TRUE; protected $usenotepad = FALSE; public $deduplica
 te_queued_notifications = TRUE; public $right = NULL; protected $type = -1; protected $displaylist = TRUE; public $showdebug = FALSE }) //html/src/CronTask.php:1018

plugin version 2.0.0

@Cyril6789
Copy link

Hello
I get exactly the same issue on 10.0.9

@TheRoby
Copy link
Contributor

TheRoby commented Oct 9, 2023

Hello,
Same here on 10.0.10

@wjs67
Copy link

wjs67 commented Oct 25, 2023

GLPI 10.0.10 - glpi-printercounters-2.0.0
PHP 8.2
Rocky Linux release 8.8 (Green Obsidian)

/var/lib/glpi/_log/php-errors.log

[2023-10-25 20:24:15] glpiphplog.WARNING: *** PHP User Warning (512): Invalid relations declared between "glpi_printers" and "glpi_plugin_printercounters_items_billingmodels" table. Target field "items_id" is not a foreign key field. in /var/www/html/glpi/src/DbUtils.php at line 2169
Backtrace :
src/DbUtils.php:2169 trigger_error()
inc/db.function.php:585 DbUtils->getDbRelations()
src/CommonDBTM.php:2508 getDbRelations()
.../twig/twig/src/Extension/CoreExtension.php:1637 CommonDBTM->canUnrecurs()
...tes/41/414913d58cb3edcdc2a715bfc546dd8f.php:360 twig_get_attribute()
vendor/twig/twig/src/Template.php:394 __TwigTemplate_814a8d775a214150e96f365b3f33e24b->doDisplay()
vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling()
vendor/twig/twig/src/Template.php:379 Twig\Template->display()
vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render()
src/Application/View/TemplateRenderer.php:163 Twig\TemplateWrapper->render()
src/CommonGLPI.php:1093 Glpi\Application\View\TemplateRenderer->render()
src/CommonGLPI.php:1211 CommonGLPI->showNavigationHeader()
plugins/fields/front/container.form.php:69 CommonGLPI->display()

[2023-10-25 20:24:15] glpiphplog.WARNING: *** PHP User Warning (512): Invalid relations declared between "glpi_printers" and "glpi_plugin_printercounters_items_recordmodels" table. Target field "items_id" is not a foreign key field. in /var/www/html/glpi/src/DbUtils.php at line 2169
Backtrace :
src/DbUtils.php:2169 trigger_error()
inc/db.function.php:585 DbUtils->getDbRelations()
src/CommonDBTM.php:2508 getDbRelations()
.../twig/twig/src/Extension/CoreExtension.php:1637 CommonDBTM->canUnrecurs()
...tes/41/414913d58cb3edcdc2a715bfc546dd8f.php:360 twig_get_attribute()
vendor/twig/twig/src/Template.php:394 __TwigTemplate_814a8d775a214150e96f365b3f33e24b->doDisplay()
vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling()
vendor/twig/twig/src/Template.php:379 Twig\Template->display()
vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render()
src/Application/View/TemplateRenderer.php:163 Twig\TemplateWrapper->render()
src/CommonGLPI.php:1093 Glpi\Application\View\TemplateRenderer->render()
src/CommonGLPI.php:1211 CommonGLPI->showNavigationHeader()
plugins/fields/front/container.form.php:69 CommonGLPI->display()

@TheRoby
Copy link
Contributor

TheRoby commented Dec 28, 2023

I searched for 2 hours, but I couldn't find the source of the problem :(

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