orchidsoftware / orchidsoftware/platform
Button on screen with pagination enabled throws an exception: method not found
@tabuna is already working on this.
Since Jun 19, 2024.
- Dominant language
- PHP
- Stars
- 4.8k
- Forks
- 662
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.