Skip to content

Error when saving an entry when Structure isn't set up for this site. #4773

@boilerroomdigital

Description

@boilerroomdigital

Description of the problem
We have a system with four MSM sites. Some use Structure, some don't. On saving an entry where Structure isn't set up I get the following error:


Deprecated

base64_decode(): Passing null to parameter #1 ($string) of type string is deprecated

ee/ExpressionEngine/Addons/structure/sql.structure.php, line 1437

Severity: E_DEPRECATED

The entry still saves but the success screen isn't shown, instead the error blocks the output.

Environment Details:

  • Version: 7.5.7
  • PHP Version 8.3.19
  • MySQL Version 5.7.42
  • OS: Linux
  • Web Server: Apache

Possible Solution
Replace line 1437 of sql.structure.php with the following:


if(is_string($pages_array))
{
		$all_pages = unserialize(base64_decode($pages_array['site_pages']));
}
else
{
	$all_pages = array();
}

There could be a better solution, but this seems to work for me.

Additional context
Our site has been updated from Version 2 via intermediate versions, so it's possible that this is the source of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: UnconfirmedBug report that is not yet confirmed and/or is not reproducible.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions