CMS MADE SIMPLE FORGE

LISE

 

[#12616] Summary template Fatal error LISEFielddefBase::offsetExists() after upgrade

avatar
Created By: Chris Taylor (chrisbt)
Date Submitted: Wed May 24 04:21:46 -0400 2023

Assigned To: Fernando Morgado (JoMorg)
Version: 1.5.4
CMSMS Version: 2.2.16
Severity: Minor
Resolution: None
State: Closed
Summary:
Summary template Fatal error LISEFielddefBase::offsetExists() after upgrade
Detailed Description:
PHP Fatal error:  Uncaught TypeError: LISEFielddefBase::offsetExists(): Return
value must be of type bool, none returned in
/var/www/html/armstrong-bell-dev/modules/LISE/lib/class.LISEFielddefBase.php:160

Upgraded a site from LISE 1.4.3 to 1.5.4 and get the above error.

It's from a summary template testing to see if a field is empty (worked in 1.4.3
not in 1.5.4):
{if !empty($item->fielddefs.company.value)} FATAL ERROR {/if}

However, just outputting the field works OK:
{$item->fielddefs.company.value}  <<< this works fine

And getting smarty to process it first also works:
{if !empty({$item->fielddefs.company.value})} THIS WORKS FINE {/if}

I tried to find the cause but I simply got lost trying to work out what LISE
should do. :/ But it looked like a call to parent::offsetExists, actually
referenced back to the LISEFielddefBase::offsetExists() that doesn't do
anything.

PHP8.0


History

Comments
avatar
Date: 2023-05-24 06:23
Posted By: Fernando Morgado (JoMorg)

I'll have to look but probably needs a #[\ReturnTypeWillChange] on either or
both files on that particular method
      
avatar
Date: 2023-08-24 12:36
Posted By: Chris Taylor (chrisbt)

CLOSED

Ignore, I was talking rubbish :/

I believe value should simply be an object property:
$item->fielddefs.location->value

not an array key: $item->fielddefs.location.value

Although i think this might have worked before
      
Updates

Updated: 2023-08-24 12:36
resolution_id: => 5
state: Open => Closed