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
I have an existing model that uses the Spatie/Sluggable package, and uses the getRouteKeyName() method to set a custom route key: 'slug'. The listing page of Runway uses the 'id' field to generate the edit link (eg. http://localhost/cp/runway/product/1), but the Resource Controller edit method uses the routeKey() method in retrieving the model record. So it is trying to find a record whose slug is '1'. This results in an "Attempt to read property "name" on null" error, since the record cannot be retrieved.
Steps to reproduce
Add getRouteKeyName() method to your model returning a key name other than 'id' (eg. 'slug')
Navigate to a Runway index page and try to edit a record
Environment
Statamic 3.1.27 Solo
Laravel 8.42.1
PHP 8.0.7
doublethreedigital/runway 2.1.1
The text was updated successfully, but these errors were encountered:
Thanks very much. Didn't know where to put this given the bug report template structure, but I only just discovered this addon yesterday, and I'm really liking it. Thanks for the work!
Description
I have an existing model that uses the Spatie/Sluggable package, and uses the getRouteKeyName() method to set a custom route key: 'slug'. The listing page of Runway uses the 'id' field to generate the edit link (eg. http://localhost/cp/runway/product/1), but the Resource Controller edit method uses the routeKey() method in retrieving the model record. So it is trying to find a record whose slug is '1'. This results in an "Attempt to read property "name" on null" error, since the record cannot be retrieved.
Steps to reproduce
Environment
Statamic 3.1.27 Solo
Laravel 8.42.1
PHP 8.0.7
doublethreedigital/runway 2.1.1
The text was updated successfully, but these errors were encountered: