Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
boilerroomdigital opened this issue Apr 4, 2025 · 1 comment · Fixed by #4815
Closed

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

boilerroomdigital opened this issue Apr 4, 2025 · 1 comment · Fixed by #4815
Labels
Bug: Unconfirmed Bug report that is not yet confirmed and/or is not reproducible.

Comments

@boilerroomdigital
Copy link

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.

@TomJaeger TomJaeger added the Bug: Unconfirmed Bug report that is not yet confirmed and/or is not reproducible. label Apr 4, 2025
@TomJaeger
Copy link
Contributor

Thanks for submitting this.

After testing, it looks like this is likely due to data being or not being present in the DB that should by default.

It's likely we should catch that case.. but also confirm whats in the DB is whats expected.

intoeetive added a commit that referenced this issue May 4, 2025
TomJaeger added a commit that referenced this issue May 14, 2025
…pages

Resolved #4773 where deprecation error could be shown on some MSM sites where Structure is installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Unconfirmed Bug report that is not yet confirmed and/or is not reproducible.
Projects
None yet
2 participants