Closed idgserpro closed 4 years ago
When we try to edit an empty collection that came from migrating from plone.app.contenttypes
1.0 to 1.1.1, we get the error:
2020-02-20 21:07:26 ERROR Zope.SiteErrorLog 1582243646.290.316684863924 http://localhost:8080/Plone/colecao-vazia/@@edit
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module plone.z3cform.layout, line 66, in __call__
Module plone.z3cform.layout, line 50, in update
Module plone.dexterity.browser.edit, line 64, in update
Module plone.z3cform.fieldsets.extensible, line 59, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 132, in update
Module z3c.form.form, line 136, in updateWidgets
Module z3c.form.field, line 277, in update
Module Products.CMFPlone.patches.z3c_form, line 46, in _wrapped
Module z3c.form.widget, line 132, in update
Module plone.formwidget.querystring.converter, line 33, in toWidgetValue
TypeError: 'NoneType' object is not iterable
So just ignoring these collections isn't a good option.
This is a really specific case and since I don't know this is going to be fixed (since it's too specific and old) I'm opening this issue to document the traceback if someone is upgrading from old installations since there's an workaround.
When upgrading a brasil.gov.portal instance, from 1.0.5 to 1.5.3, plone.app.contenttypes goes from 1.0 to 1.1.1 and collective.nitf from 1.0b3 to 2.1b4.
If you created an empty collection when plone.app.contenttypes was 1.0, and upgrade it afterwards, and run upgradeStep 1008 from collective.nitf, you get:
If you have an old installation with collective.nitf 1.0b3, plone.app.contenttypes 1.0 and update to collective.nitf 2.1b4, and plone.app.contenttypes to 1.1.6, when running the upgradeStep, you get the same error. I've attached two .cfgs, one for 1.0b3 and another for 2.1b4 to recreate the instances in these versions. cfgs.zip
Workaround: you can create a Python Scrip in the ZMI to list these problematic collections and delete them, This way, you can run the upgradeStep again:
(Possibly related: https://github.com/collective/collective.nitf/commit/0fef6227868d9f1c25177af2b589a36caf1759ed)