Skip to content
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

[Error] Attempt to modify property "tags" on null #196

Open
GaryReckard opened this issue Dec 3, 2024 · 0 comments
Open

[Error] Attempt to modify property "tags" on null #196

GaryReckard opened this issue Dec 3, 2024 · 0 comments

Comments

@GaryReckard
Copy link

I'm seeing this error "[Error] Attempt to modify property "tags" on null" show up on my production site that I just upgraded from Craft 3 to Craft 5, when using the element-api and when no results are returned. This doesn't happen locally, haven't figured out why yet, but I did notice when inspecting the code that these lines:

[$dep, $maxDuration] = $elementsService->stopCollectingCacheInfo();
$dep->tags[] = 'element-api';

are going to fail with that error this due to these lines:

        if (empty($tags)) {
            return [null, null];
        }

in
https://github.com/craftcms/cms/blob/00a6febb85972771ca9af8d42abb28c5cd24a40a/src/services/Elements.php#L749-L751

Not sure the best resolution here, but wanted to flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant