[Tickets #15093] Logfile clogged with PHP error messages when using PHP 7.4

noreply at bugs.horde.org noreply at bugs.horde.org
Wed Feb 2 15:37:29 UTC 2022


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: https://bugs.horde.org/ticket/15093
------------------------------------------------------------------------------
  Ticket           | 15093
  Erstellt Von     | wahnes at uni-koeln.de
  Zusammenfassung  | Logfile clogged with PHP error messages when using PHP
                   | 7.4
  Warteschlange    | Horde Framework Packages
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 2. Medium
  Milestone        |
  Patch            | 1
  Zuständige       |
------------------------------------------------------------------------------


wahnes at uni-koeln.de (2022-02-02 15:37) hat geschrieben:

When using the current Horde 5 packages with PHP 7.4, a lot messages  
are sent to the log files regarding the use of array indexes with NULL  
values. With PHP 7.4, this kind of access pattern causes these notices  
to generated, which was not the case with earlier PHP versions. While  
it's possible to adjust the Horde log level in order to get rid of  
these messages, I'd prefer if this could be resolved in the code base,  
at least for the majority of cases.

One of the most prominent examples is in Horde/Themes (part of the  
Horde_Core package). As this is called very often, it generates a lot  
of noise in the log files. Here's an example of a message typically  
logged several times per second:

HORDE[421302]: [horde] PHP ERROR: Trying to access array offset on  
value of type null [pid 421302 on line 146 of  
"/usr/share/pear/Horde/Themes/Element.php"]

This can easily be resolved by checking the value using "isset".  
Attached is a simple patch for the above case of Horde/Themes.

Other common cases that show up in the log files quite often are these two:

PHP ERROR: Trying to access array offset on value of type null [pid  
421302 on line 396 of "[...]/kronolith/lib/CalendarsManager.php"
PHP ERROR: Trying to access array offset on value of type null [pid  
421302 on line 668 of "[...]/imp/lib/Contents.php"

These latter ones affect Kronolith and Imp. I guess I could write  
patches for these, too. I'm just not sure if applying my patches would  
be even more troublesome for you than fixing this yourself. Maybe  
you're not even convinced this needs fixing at all? Please let me know  
what you prefer (create two new bug tickets in the respective queues,  
provide patches there, or add them here) and I'll provide patches for  
these additional instances or not.




wahnes at uni-koeln.de (2022-02-02 15:37) hat hochgeladen: horde-theme.patch

https://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=horde-theme.patch&ticket=15093&fn=%2Fhorde-theme.patch





More information about the bugs mailing list