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

Error when I have configured action "detail" for crud page "index" in my dashboard #1

Open
OleksiiBulba opened this issue Mar 19, 2023 · 0 comments

Comments

@OleksiiBulba
Copy link

Hello!

I added easy-config-bundle to my project, and configured everything according to the README.md and after that, I got an error:

The "detail" action already exists in the "index" page, so you can't add it again. Instead, you can use the "updateAction()" method to update any options of an existing action.

The reason is that I've added the action "detail" to all crud pages "index" in my dashboard, and easy-config-bundle tries to add it again.

The workaround is removing it from my dashboard "configureActions" to each of my crud controllers to avoid the error.
Is it possible to fix it in your bundle?

I did a small change:

try {
    $actions->add(Crud::PAGE_INDEX, Action::DETAIL);
} catch (\InvalidArgumentException) {}

and it kinda worked. The method add throws \InvalidArgumentException only in one case, so it is a valid option, IMO.

If it is allowed, I can create an MR for it by myself.

Thanks in advance!

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