Problem/Motivation

The Salesforce Mapping UI module throws the following PHP warning:
Warning: foreach() argument must be of type array|object, null given
This happens in MappedObjectController.php when the code tries to iterate over the route’s parameters option.
When a route does not declare it, getOption('parameters') returns NULL.
PHP 8+ no longer silently ignores this—attempting to foreach() over NULL produces a warning.

Patch created to return an array instead of NULL.

Comments

sabrina.liman created an issue. See original summary.

sabrina.liman’s picture

colinstillwell’s picture

Status: Active » Needs review
aaronbauman’s picture

Status: Needs review » Reviewed & tested by the community

LGTM, thanks

  • aaronbauman committed 3bb5b726 on 5.1.x
    fix: #3562234 Warning: foreach() argument must be of type array|object,...
aaronbauman’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thanks again.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • aaronbauman committed 3bb5b726 on sniff-test
    fix: #3562234 Warning: foreach() argument must be of type array|object,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.