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

Remove all global scopes instead of just trashed #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JHWelch
Copy link

@JHWelch JHWelch commented Jan 7, 2024

Right now the loadRecord only removes the trashed global scope when it is present.

However, this causes a problem for other records with Global Scopes. It seems Nova itself will ignore these scopes when serving a detail page, so it means you can view records that then fail when you click on auditable log with the following error when the resource is not properly loaded.

Too few arguments to function Devpartners\AuditableLog\ToolServiceProvider::Devpartners\AuditableLog\{closure}(),
1 passed in {{repo}}/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 548 and exactly 2 expected

As a side effect, the withoutGlobalScopes also removes the trashed scope, so you can remove the ternary.

Let me know if you'd like me to take another approach, but I think this is fine with how Nova already works.

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant