-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Broken checkboxes in MultipleChooserPanel
modal when USE_THOUSAND_SEPARATOR
is True
#11137
Conversation
Manage this branch in SquashTest this branch here: https://codesmith25103main-agok7.squash.io |
@@ -1,4 +1,4 @@ | |||
{% load i18n %} | |||
<td {% if column.classname %}class="{{ column.classname }}"{% endif %}> | |||
<input type="checkbox" id="chooser-modal-select-{{ value }}" data-multiple-choice-select name="id" value="{{ value }}" title="{% blocktrans trimmed with title=instance %}Select {{ title }}{% endblocktrans %}"> | |||
<input type="checkbox" id="chooser-modal-select-{{ value }}" data-multiple-choice-select name="id" value="{{ value|unlocalize }}" title="{% blocktrans trimmed with title=instance %}Select {{ title }}{% endblocktrans %}"> |
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.
The other occurrence of value
(in "chooser-modal-select-{{ value }}"
) needs updating too. Have also just noticed that there's another template that needs the same fixes - wagtail/admin/templates/wagtailadmin/chooser/tables/page_checkbox_select_cell.html
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.
Thanks for reviewing. I will make required changes.
I have made required changes. Please review it |
MultipleChooserPanel
modal when USE_THOUSAND_SEPARATOR
is True
It might be good to have a unit test supporting this also, so that it doesn't break again in the future. |
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.
This is currently failing when I test it on the bakerydemo site (by editing any blog page, and clicking the "Add author" button which should open the chooser popup) because the template isn't loading the l10n
tag library (which is required for the unlocalize
filter).
I would have expected the existing unit tests to catch this error, so it seems that we're lacking some test coverage for this.
So do I have to write unit test to catch this error? |
I have added l10n tag in both the files. Hope it will resolve the issue. |
@codesmith25103 you may want to add a test for this change.
The view is located in class TestChooserBrowse(WagtailTestUtils, TestCase):
@override_settings(USE_THOUSAND_SEPARATOR=True)
def test_multiple_chooser_view(self):
response = self.get({"multiple": "1"}) # something like this
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "wagtailadmin/chooser/browse.html")
# check that the values are correct
# We may need to add a page that has an id of over 1000
# we will also need to test this with the setting turned off
# test data is set in wagtail/test/testapp/fixtures/test.json but we can also add a page on the fly in this test Hopefully that helps as a starting point, a similar test will be needed for the generic multiple chooser but maybe get the page one working first. |
@codesmith25103 are you OK to create a unit test for this? |
Hey @lb-, I apologize for the delay. Due to some health and family issues, I wasn't able to complete it. However, I have already started working on it and will update you soon. |
No problems @codesmith25103 - I hope you and your family are OK. |
Thanks @codesmith25103 looks like a new PR has taken this and added unit tests. We will ensure we mention you in the release notes, thanks for getting this started. |
Fixes #...
Issue Number #11134
I attempt to solve the issue as it was mentioned in PR. I have used the filter "|unlocalize" at a correct place to solve this issue
Please check the following:
make lint
from the Wagtail root.Please describe additional details for testing this change.
Footnotes
Development Testing ↩
Browser and device support ↩
Accessibility Target ↩