-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pagination broken in 0.15 for customized views #1957
Comments
Thank you for reporting @mmrobins. You are right that this is a breaking change and we should have communicated it. In general, whenever we make changes to the default templates there's a chance that we'll introduce something that breaks custom templates. It's a difficult problem to solve, and particularly in this specific case I'm not sure it can be avoided at all, as there are several factors that we can't control. Generally it's a good idea to check template changes when upgrading Administrate, but we should communicate it better. Perhaps we should list affected templates in the changelogs. Unfortunately, I think that this specific bug doesn't really have a fix, beyond hoping that users will eventually all migrate and the problem will disappear. Therefore I'm going to close this issue, but I'm glad that you opened it in the first place, as it may help others. |
Currently, it lists which template files have changed since the version given as an argument (actually a Git tag): ``` $ ./bin/changelog v0.15.0 The following templates have changed since v0.15.0: app/views/administrate/application/_navigation.html.erb app/views/fields/url/_index.html.erb app/views/fields/url/_show.html.erb ``` If your application overrides any of them, make sure to review your custom templates to ensure that they remain compatible. This was inspired by #1957, where a user observed that it would be worth mentioning these template updates in the changelog, as it's something that people need to look out for when upgrading Administrate.
Thank you for posting this @mmrobins and turning it into a quick fix. I expect things like this, but definitely agree that a list of affected templates or potentially breaking changes would be helpful for avoiding hunts through the codebase. |
Worth mentioning that we have starting doing this with templates. See the changelog for v0.16.0: https://github.com/thoughtbot/administrate/releases/tag/v0.16.0 As for other breaking changes, we try to keep things back-compatible or give deprecation warnings, but there is not guarantee that something won't slip through. |
tl;dr the
CHANGELOG.md
should call out* [BUGFIX] [#1725] Fix pagination of "Page" models.
as breaking pagination for customized views.After I upgraded 0.14.0 -> 0.15.0 I started getting issues with pagination
I have
config.action_controller.action_on_unpermitted_parameters = :raise
, so started seeing errorsI tried disabling that, but ended getting the
page
param stripped, so paging didn't work.I finally tracked down the reason being #1725 changing the paging parameter from
page
to_page
. This would be fine, but if you've customized yourindex.html.erb
at all, you won't get the update to fix that rename.My fix ended up being pretty, simple, just unexpected to need it
I looked through the
CHANGELOG.md
but didn't see anything that would have led me to expect this, so posting here in case anyone else bangs there head against this.It would be great if versioning for this could bump to
1.0
so that future version bumps could use semver to communicate breaking changes more clearly. I get the project wants to be able to make breaking changes, but it seems mature enough that communicating that through semver would be pretty helpful.Thanks for the taking the time to look through this, and for the great library.
The text was updated successfully, but these errors were encountered: