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

Handle hook signature change in Wagtail 2.10+ #44

Merged
merged 2 commits into from
Jan 7, 2021

Conversation

chosak
Copy link
Member

@chosak chosak commented Jan 6, 2021

As of version 2.10, certain Wagtail hooks now accept an optional next_url keyword argument. This includes the register_page_listing_more_buttons hook used in this project.

Users of Wagtail 2.10 and 2.11 currently see this deprecation warning:

RemovedInWagtail212Warning: register_page_listing_more_buttons hooks will require an additional kwarg next_url in a future release. Please update your hook function to accept next_url.

This commit fixes that warning while still maintaining compatibility with the older versions of Wagtail.

Checklist

  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the front end playbook
  • Passes all existing automated tests
  • New functions include new tests
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged
  • Visually tested in supported browsers and devices
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

As of version 2.10, certain Wagtail hooks new accept an optional
next_url keyword argument. [0] This includes the
register_page_listing_more_buttons hook used in this project.

Users of Wagail 2.10 and 2.11 currently see this deprecation warning:

> RemovedInWagtail212Warning: register_page_listing_more_buttons hooks
> will require an additional kwarg `next_url` in a future release. Please
> update your hook function to accept `next_url`.

This commit fixes that warning while still maintaining compatibility
with the older versions of Wagtail.

[0] https://docs.wagtail.io/en/stable/releases/2.10.html#new-next-url-keyword-argument-on-register-page-listing-buttons-and-register-page-listing-more-buttons-hooks
@chosak chosak requested a review from a team January 6, 2021 17:02
@chosak chosak merged commit ff068d9 into main Jan 7, 2021
@chosak chosak deleted the fix/more-hook-deprecation branch January 7, 2021 15:08
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

Successfully merging this pull request may close these issues.

None yet

3 participants