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

Fixed IndexError when a translation with overridden and unchanged Chooser inside a ListBlock is published #856

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

murray3k
Copy link

This affected all Choosers inside a ListBlock , when only one of them is translated and the other kept unchanged.
I added a simple empty check to handle_list_block so that self.handle_block is not called when there are no block_segments , which was causing the IndexError later. This fixes #855.

Added two Tests. One with images in a list where only one is changed and another one for a list with PageChooserBlocks. Might be redundant, but I wanted to test that this issue is with all choosers and not just the PageChooserBlock where we encountered it.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.18%. Comparing base (0800647) to head (619a676).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
+ Coverage   93.13%   93.18%   +0.04%     
==========================================
  Files          47       47              
  Lines        4241     4242       +1     
  Branches      550      551       +1     
==========================================
+ Hits         3950     3953       +3     
+ Misses        174      173       -1     
+ Partials      117      116       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

ListBlock with PageChooserBlock can cause IndexError with mixed translations
2 participants