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

Button on resource with custom indexQuery with grouped results failed #91

Open
stardothosting opened this issue Jul 27, 2021 · 1 comment

Comments

@stardothosting
Copy link

stardothosting commented Jul 27, 2021

Hello,

I have built a custom resource page and want to attach your button to link to a controller (or anywhere really). I am getting a 404 not found error because resourceId is null :

/nova-vendor/nova-button/<resource name>/null/text 404 (Not Found)

resourceId is null because each row on this resource is a group of a bunch of rows combined together (i.e. 10 Cars of this model).

Is there a workaround to this dependency? For example I cant even use the button to create a link to an external website because of this dependency.

@stardothosting
Copy link
Author

Right now if I change this line in src/Http/Controllers/ButtonController.php from :

$resource = $request->findModelQuery()->firstOrFail();

to :

$resource = $request->findModelQuery()->first();

The issue doesnt happen anymore

dnwjn added a commit to dnwjn/nova-button that referenced this issue Feb 5, 2022
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