tomolimo / ticketcleaner

Home for Ticket Cleaner GLPI plugin
8 stars 2 forks source link

[GLPI 9.5.5+ticketcleaner 3.0.0] PHP Warning array_key_exists() in ticketcleaner/hook.php #23

Closed jgrunder closed 9 months ago

jgrunder commented 3 years ago

Hi there,

I've upgraded my GLPI installation to 9.5.5 and reinstall this plugin to version 3.0.0 and I have PHP warnings at each incoming mails:

[2021-07-29 09:25:04] glpiphplog.WARNING:   *** PHP Warning (2): array_key_exists() expects parameter 2 to be array, bool given in /var/www/html/glpi/plugins/ticketcleaner/hook.php at line 246
  Backtrace :
  plugins/ticketcleaner/hook.php:246                 array_key_exists()
  plugins/ticketcleaner/hook.php:393                 PluginTicketCleaner::cleanText()
  inc/plugin.class.php:1353                          PluginTicketCleaner::plugin_pre_item_add_ticketcleaner()
  inc/commondbtm.class.php:1123                      Plugin::doHook()
  inc/mailcollector.class.php:820                    CommonDBTM->add()
  inc/mailcollector.class.php:1742                   MailCollector->collect()
  inc/crontask.class.php:943                         MailCollector::cronMailgate()
  front/cron.php:83                                  CronTask::launch()

[2021-07-29 09:25:04] glpiphplog.WARNING:   *** PHP Warning (2): array_key_exists() expects parameter 2 to be array, bool given in /var/www/html/glpi/plugins/ticketcleaner/hook.php at line 247
  Backtrace :
  plugins/ticketcleaner/hook.php:247                 array_key_exists()
  plugins/ticketcleaner/hook.php:393                 PluginTicketCleaner::cleanText()
  inc/plugin.class.php:1353                          PluginTicketCleaner::plugin_pre_item_add_ticketcleaner()
  inc/commondbtm.class.php:1123                      Plugin::doHook()
  inc/mailcollector.class.php:820                    CommonDBTM->add()
  inc/mailcollector.class.php:1742                   MailCollector->collect()
  inc/crontask.class.php:943                         MailCollector::cronMailgate()
  front/cron.php:83                                  CronTask::launch()

[2021-07-29 09:25:04] glpiphplog.WARNING:   *** PHP Warning (2): array_key_exists() expects parameter 2 to be array, bool given in /var/www/html/glpi/plugins/ticketcleaner/hook.php at line 333
  Backtrace :
  plugins/ticketcleaner/hook.php:333                 array_key_exists()
  plugins/ticketcleaner/hook.php:395                 PluginTicketCleaner::cleanImages()
  inc/plugin.class.php:1353                          PluginTicketCleaner::plugin_pre_item_add_ticketcleaner()
  inc/commondbtm.class.php:1123                      Plugin::doHook()
  inc/mailcollector.class.php:820                    CommonDBTM->add()
  inc/mailcollector.class.php:1742                   MailCollector->collect()
  inc/crontask.class.php:943                         MailCollector::cronMailgate()
  front/cron.php:83                                  CronTask::launch()
tomolimo commented 3 years ago

Hello @jgrunder Could you provide more info on how to reproduce this warning? Thank you Regards, Tomolimo

jgrunder commented 3 years ago

Hello @tomolimo I don't know how to reproduce this warning, maybe it's related to the mails themselves. This warning appears as soon as the mailgate retrieves an email and runs this plugin, there are no configuration options so I don't know what makes my GLPI environment different from yours.

tomolimo commented 3 years ago

Hello @jgrunder Do you have any defined filters? Do you use IMAP or POP3 protocol in your receiver? Could you post an email in EML format so that I can try to reproduce? Thank you Regards, Tomolimo

jgrunder commented 3 years ago

Hm I have no filter in database and I can't find anywhere to add and manage current filters

jgrunder commented 3 years ago

Can you tell me where I can add and edit filters ? I didn't find in your Wiki where to do this. (Note that his warning does not occur at each email, I am doing additional tests to understand when PHP returns this warning)

tomolimo commented 3 years ago

Hello @jgrunder Here you'll find the filters if any: image

jgrunder commented 3 years ago

Hi, So I confirm, I have no filters. Are you not able to reproduce this issue ? What version of PHP is recommended for this plugin ? Thanks for your support.

tomolimo commented 1 year ago

Hello @jgrunder Sorry for being so late to answer to your question. There is no special PHP version, the GLPI one is good. Do you still have this warning? Thank you, Regards, Tomolimo

tomolimo commented 9 months ago

Hello @jgrunder I closed this issue as there is no news, but feel free to reopen if you need to post news. Thank you, Regards, Tomolimo