whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

Nova 2.0.1 breaks resource update #28

Closed raphcollective closed 5 years ago

raphcollective commented 5 years ago

After updating to Nova 2.0.1 I can't update pages anymore this function call aborts with a 404.

I'm currently digging to find a solution though I don't know Nova well enough and not having a commit history obviously doesn't help. This is what the changelog states for this version:

Security: prevent escaping the CSV parsing logic when validating unique values on resource update.

I will update the issue with my findings, I'm using Laravel 5.8.8

raphcollective commented 5 years ago

I found the culprit, since Nova 2.0.1 the InteractsWithResources trait's function resource() doesn't use the $resource parameter from the request anymore. Instead it uses the route parameter {resource} to determine the requested resource.

Below a comparison of the same line: Nova 2.0.0 return tap(Nova::resourceForKey($this->resource), function ($resource) { Nova 2.0.1 return tap(Nova::resourceForKey($this->route('resource')), function ($resource) {

Not sure how I can help from there as I don't think we can really override the original nova route by using a {resource} parameter on the nova-page one. If you have a clear idea on how to fix this I can do it for you, let me know.

voidgraphics commented 5 years ago

Thanks for reporting, this is up high on our priority list.

toonvandenbos commented 5 years ago

Hi @raphcollective,

Thanks for your research, it helped me resolving this issue. You rock! :)

raphcollective commented 5 years ago

Hey @Nyratas anytime! Thanks for the quick fix, it's really appreciated