-
Notifications
You must be signed in to change notification settings - Fork 824
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
Port betterbuttons to framework #8569
Port betterbuttons to framework #8569
Conversation
8a8a0dc
to
a9f3c77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Biggest thing is I see a lot of artefacts from BetterButtons that don't apply here, such as owner
and Controller::curr()
, in addition to a number of other syntactical issues.
Second major thing is these will need unit tests.
Otherwise, I think you've done a good job of containing the story and not blowing up the API too much in the interest of parity with BetterButtons. We can improve upon this in a future story.
a9f3c77
to
0c08821
Compare
c68d5a7
to
1759224
Compare
Rectified all the requested changes.
6e20bda
to
2ae244b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting there. High level points:
- Change
showNext
andshowPrev
to a monolithicshowPagination
- Refactor getPreviousID() and getNextID() to be more scalable. Current implementation is inherently flawed.
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Menu.md
Outdated
Show resolved
Hide resolved
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Menu.md
Outdated
Show resolved
Hide resolved
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Menu.md
Outdated
Show resolved
Hide resolved
{ | ||
Controller::curr()->getResponse()->addHeader("X-Pjax", "Content"); | ||
$link = $this->getEditLink($this->getNextRecordID()); | ||
return Controller::curr()->redirect($link); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getResponse()
isn't available on RequestHandler
. Let's use $this->getTopLevelController()->getResponse()
and $this->redirect()
.
The changes to We haven't broken any APIs, so this is safe to merge into a minor release, but I think we should at least check in with the maintainers to let them know about this change so they can issue a 4.4.x compatible release. CC @robbieaverill @NightJar |
Thank for checking @unclecheese, we'll test it out. Hopefully nothing breaks, it might get a little hairy to adjust the code to support both versions if it does - we'll see =) |
If the form is opened via a grid field, the filters will be retained so the previous/next record opened will be correct
…xt` and `Add` buttons at a `GridField` level
…ess `betterbuttons` module was installed
…elds - Update documentation - Improve performance for next/previous buttons by not fetching all list records - Refactoring
77fba55
to
d990ecc
Compare
Awesome. Tests were failing because Other minor points:
Merge on green. |
We should add this to phpcs rules. Related: #8343 |
This adds
Previous
,Next
andAdd
buttons to the edit form. It should also retain the search filters from the grid field where it was opened from.Fixes #436