You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an existing import to a non-primary site, which is working fine, except for disabling the elements that no longer exist in the import ("Disable missing elements globally"). In the log, in the last step, there's always this error: Attempt to read property "enabled" on null.
This is trying to get the element to disable it. But because the $siteId isn't passed to getElementById (the third argument), it tries to find it in the primary site. But the problem is the elements we're importing aren't in the primary site.
I fixed it by passing "*" as the site id. Since the feed option includes the word "globally", and the same class has another method called disableForSite(), I think "*" is the right choice.
Description
We have an existing import to a non-primary site, which is working fine, except for disabling the elements that no longer exist in the import ("Disable missing elements globally"). In the log, in the last step, there's always this error:
Attempt to read property "enabled" on null.
The error occurs on this line: https://github.com/craftcms/feed-me/blob/5.5.0/src/base/Element.php#L215
That method:
This is trying to get the element to disable it. But because the
$siteId
isn't passed togetElementById
(the third argument), it tries to find it in the primary site. But the problem is the elements we're importing aren't in the primary site.I fixed it by passing
"*"
as the site id. Since the feed option includes the word "globally", and the same class has another method calleddisableForSite()
, I think"*"
is the right choice.Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: