db condition and join causes fatal errors in PHP 8

Created on 25 March 2022, over 2 years ago
Updated 14 July 2023, 12 months ago

Problem/Motivation

Updated to php 8, got WSOD. Looking at the watchdog log shows this error:
a:6:{s:5:"%type";s:9:"TypeError";s:8:"!message";s:39:"Unsupported operand types: int - string";s:9:"%function";s:25:"advagg_bundler_analysis()";s:5:"%file";s:81:"/var/www/bayhar/www/sites/all/modules/advagg/advagg_bundler/advagg_bundler.module";s:5:"%line";i:143;s:14:"severity_level";i:3;}

Proposed resolution

After changing line 143 from:
->condition('aav.atime', REQUEST_TIME - max(172800, variable_get('advagg_bundler_outdated', ADVAGG_BUNDLER_OUTDATED), '>'), '>');
to:
->condition('aav.atime', REQUEST_TIME - max(172800, variable_get('advagg_bundler_outdated', ADVAGG_BUNDLER_OUTDATED)), '>');

It then flagged up another line, 375:
->condition('aav.atime', REQUEST_TIME - max(172800, variable_get('advagg_bundler_outdated', ADVAGG_BUNDLER_OUTDATED), '>'), '>');
Adjusted to:
->condition('aav.atime', REQUEST_TIME - max(172800, variable_get('advagg_bundler_outdated', ADVAGG_BUNDLER_OUTDATED)), '>');

This then let the page load.

Not sure if this is a fault on my install, but the code didn't read right from my end, the double '>'), '>') didn't seem to match the max/condition issues.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom overbythere

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024