Skip to content

Fix AttributeError for containers with more than 25 rows#53

Merged
ramonski merged 2 commits into2.xfrom
fix-rows-error
Aug 6, 2025
Merged

Fix AttributeError for containers with more than 25 rows#53
ramonski merged 2 commits into2.xfrom
fix-rows-error

Conversation

@xispa
Copy link
Member

@xispa xispa commented Aug 4, 2025

Description of the issue/feature this PR addresses

This Pull Request fixes an error that arises when resolving the letters that correspond to a given row and the position of the row is equal or greater than alphabet's length (26). For instance, this happens when trying to render a layout for a sample container with 50 rows and 1 column:

20250804192008

Current behavior before PR

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 288, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 666, in __call__
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 399, in upgrade_product
  Module Products.GenericSetup.tool, line 1202, in upgradeProfile
  Module Products.GenericSetup.upgrade, line 185, in doStep
  Module senaite.storage.upgrade.v02_07_000, line 381, in migrate_storage_root_folder_to_dx
  Module OFS.CopySupport, line 326, in manage_pasteObjects
  Module OFS.CopySupport, line 237, in _pasteObjects
  Module Products.BTreeFolder2.BTreeFolder2, line 469, in _setObject
  Module zope.event, line 33, in notify
  Module zope.component.event, line 27, in dispatch
  Module zope.component._api, line 134, in subscribers
  Module zope.interface.registry, line 448, in subscribers
  Module zope.interface.adapter, line 899, in subscribers
  Module zope.component.event, line 36, in objectEventNotify
  Module zope.component._api, line 134, in subscribers
  Module zope.interface.registry, line 448, in subscribers
  Module zope.interface.adapter, line 899, in subscribers
  Module OFS.subscribers, line 116, in dispatchObjectMovedEvent
  Module zope.container.contained, line 157, in dispatchToSublocations
  Module zope.component._api, line 138, in handle
  Module zope.interface.registry, line 448, in subscribers
  Module zope.interface.adapter, line 899, in subscribers
  Module OFS.subscribers, line 116, in dispatchObjectMovedEvent
  Module zope.container.contained, line 157, in dispatchToSublocations
  Module zope.component._api, line 138, in handle
  Module zope.interface.registry, line 448, in subscribers
  Module zope.interface.adapter, line 899, in subscribers
  Module senaite.storage.subscribers, line 29, in StorageContentAddedEventHandler
  Module senaite.storage.content.storage_layout_container, line 265, in rebuild_layout
  Module senaite.storage.content.storage_layout_container, line 264, in <lambda>
  Module senaite.storage.content.storage_layout_container, line 226, in position_to_alpha
  Module senaite.storage.content.storage_layout_container, line 220, in get_alpha_row
AttributeError: 'RequestContainer' object has no attribute 'get_alpha_column'

Desired behavior after PR is merged

No error, rows beyond Z are rendered in Layout view:

20250804192143

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@xispa xispa requested a review from ramonski August 4, 2025 17:24
@xispa xispa added the Bug 🐞 Something isn't working label Aug 4, 2025
Copy link
Contributor

@ramonski ramonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ramonski ramonski merged commit 6cbf280 into 2.x Aug 6, 2025
2 checks passed
@ramonski ramonski deleted the fix-rows-error branch August 6, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug 🐞 Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants