Closed daun closed 1 week ago
Update: this only happens when fetching entries from the control panel json endpoint, not when mutating in the frontend view itself. So it reliably happens when displaying entries from a collection
dashboard panel, or when rendering a Bard field in the entries listing. Might have to do with the augmentation state of the bard content field?
Thanks for the report and details! Fixed in v3.0.1.
Amazing — thanks for the quick fix!
Unfortunately, this still isn't fixed for me - it seems like the change in 3.0.1 is just a change to the log file?
https://github.com/jacksleight/statamic-bard-mutator/commit/75e64b3579e933738a3a6fe621306d6d3676a037
@lvmbard Installing 3.0.1 definitely fixed the issue here. If you look at the comparison between 3.0.0 and 3.0.1, you'll see it contains more than the commit you've linked.
@daun Thanks for the quick reply - we've freshly installed 3.0.1 and still experience this same error when using the below example from the docs:
Mutator::html('table', function ($value) {
$inner = array_splice($value, 2, count($value), [0]);
$value = ['div', ['class' => 'table-wrapper'], $value, ...$inner];
return $value;
});
@lvmbard Could you share the output from php please support:details
and let me know exactly where you're seeing the error, a full stack trace would also be really helpful if possible.
I'm away right now but I'll take a look when I'm back.
@jacksleight Thanks for getting back to me, here's the output of that command:
Environment
Application Name: *****
Laravel Version: 11.23.5
PHP Version: 8.3.10
Composer Version: 2.7.4
Environment: local
Debug Mode: ENABLED
URL: *****
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED
Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: cookie
Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.8.0
PHP SDK Version: 4.9.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: 20%
Sample Rate Profiling: 100%
Send Default PII: DISABLED
Statamic
Addons: 2
Sites: 3
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.24.0 PRO
Statamic Addons
jacksleight/statamic-bard-mutator: 3.0.1
statamic/eloquent-driver: 4.14.0
Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: eloquent
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Sites: file
Taxonomies: eloquent
Terms: eloquent
Tokens: file
The issue occurs when trying to edit a page within the admin panel (the same page will work fine on the frontend).
Bug Description
After upgrading to
3.0
, I'm getting the following error when mutating links.How to Reproduce
I'm using the example from the docs for marking external links.
This is the Bard field data in question that throws. Removing it also gets rid of the exception.
That's the url that throws:
Extra Detail
It looks like for some reason the
$info
var fetched fromMutator::fetchInfo()
is empty for that particular node. That's where I'm getting lost on the inner workings of the addon, though :)Environment