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 when using @seo_pro('meta') in a blade template #355

Open
321zeno opened this issue Oct 14, 2024 · 3 comments
Open

Error when using @seo_pro('meta') in a blade template #355

321zeno opened this issue Oct 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@321zeno
Copy link

321zeno commented Oct 14, 2024

Getting

TypeError
array_merge(): Argument #2 must be of type array, null given

php please support:details:

Environment
Application Name: Statamic
Laravel Version: 11.26.0
PHP Version: 8.3.11
Composer Version: 2.2.6
Environment: local
Debug Mode: ENABLED
URL: headless-cms.local
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / daily
Mail: log
Queue: redis
Session: file

Statamic
Addons: 3
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.28.0 PRO

Statamic Addons
statamic-rad-pack/runway: 7.10.1
statamic/eloquent-driver: 4.15.0
statamic/seo-pro: 6.2.0

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: file
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: file
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: file

After some debugging I notice in
https://github.com/statamic/seo-pro/blob/master/src/Tags/SeoProTags.php#L39
$this->context->value('seo') is always null because the seo key is not set on the context.

I reviewed the setup instructions a few times but I can't figure out why the seo is missing from the context, can anyone please help?
Thanks

Edit:
I spotted another warning that might be relevant, before the array_merge error:

LOG.warning: trim(): Passing null to parameter #1 ($string) of type string is deprecated in {...}/vendor/statamic/seo-pro/src/Cascade.php on line 353
@duncanmcclean duncanmcclean added the bug Something isn't working label Oct 14, 2024
@321zeno
Copy link
Author

321zeno commented Oct 15, 2024

I fired up xdebug today and noticed that actually the error comes from here
https://github.com/statamic/seo-pro/blob/master/src/Cascade.php#L386
for the $item "{{ git }} add {{ paths }}"

If I comment out the return $this->parseAntlers($raw); here the directive works as expected

@duncanmcclean
Copy link
Member

Are you able to provide the full stack trace?

@SomeGuyNamedAlex
Copy link

@duncanmcclean not the original poster, but we got the same bug, here's our stack trace : https://flareapp.io/share/dPb0QVN5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants