Skip to content

erp5_core: Disable content listbox in metadata when not a folder

We now disable the content listbox (showing subobjects of the current object) that was added in 4441e5c8, in case the object is not a Folder, as it otherwise raises an error such as:

Error Type: TypeError
Error Value: Item.objectValues() got an unexpected keyword argument 'checked_permission'

This bug was detected by navigating to the Metadata tab of an extension component (which does not subclass Folder, and thus inherits the objectValues method from Zope's SimpleItem).

The error happens because ListMethodWrapper passes Listbox's list arguments to the wrapped method, which breaks for objectValues when it does not accept extra arguments.

As the error only affects this listbox for now, it was decided that it was better to just disable the listbox for non-Folder objects (see discussion in MR !2340 (merged)).

Edited by Carlos Ramos Carreño

Merge request reports