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 screen with pagination enabled throws an exception: method not found #2845

Open
nyrov opened this issue Jun 19, 2024 · 0 comments
Open
Assignees
Labels

Comments

@nyrov
Copy link

nyrov commented Jun 19, 2024

Describe the bug
Hello. I have a screen with pagination enabled, so pages comes with URLs like /images/all?page=1

I place a button in a modal window on the screen. Like that:
Layout::modal (async)
.. Layout::table
.... TD::make
...... ->render
........ Button::make('text')->method('setImage', [
........ 'preview' => $preview->id,
........ 'image' => $this->image->id,
........ ]),

Buttons are created with:
formaction="http://.../images/all?page=1/setImage?preview=629&image=75"

That's because
Button.php:81
$action = rtrim("{$url}/{$this->get('method')}?{$query}", '/?');

and $url = http://.../images/all?page=1

So then I click on the button it throws an exception: method all() not found
If I open URL without ?page=1 everything works as expected.

How can it be fixed? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants