plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
246 stars 187 forks source link

Missing upgrade step in Plone 5.1 #2331

Closed sneridagh closed 6 years ago

sneridagh commented 6 years ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

Missing upgrade step in Plone 5.1

What I did:

Upgrading from 5.1rc1 (version originally installed) to 5.1 triggered:

KeyError: 'Interface Products.CMFPlone.interfaces.controlpanel.IImagingSchema defines a field 'highpixeldensity_scales', for which there is no record.'

when accessing image scales. Checked out on the IImagingSchema, and the record was not there. I fixed it by executing manually this upgrade step (that indeed it exists for 5.1b2 to 5.1b3):

plone/app/upgrade/v51/profiles/to_beta3/registry.xml

Right now I can't take a look myself into this if someone can fix it quickly would be great.

What I expect to happen:

The scale record should be created on site's registry. Could happen to other versions to 5.1 as well.

What actually happened:

It errored :)

What version of Plone/ Addons I am using:

Plone 5.1, plone.restapi

/cc @tisto

mauritsvanrees commented 6 years ago

Confirmed. This is due to the renaming of the retina_scales field to highpixeldensity_scales in bd04fe15bdddc339f449752a055e4cdfb0038bfc.

Applying that registry.xml step would indeed fix it:

  <records interface="Products.CMFPlone.interfaces.IImagingSchema"
           prefix="plone" />

You would lose a previous setting of retina_scales, but I'd say it is unlikely that someone has changed this. And if they did, nothing bad happens. Would be nicer to migrate that setting, but that may be overkill. But it could be simple, I didn't try it yet.

mrsaicharan1 commented 6 years ago

@sneridagh So would the probable fix for this issue be an addition of the highpixeldensity_scales record to https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/profiles/dependencies/registry.xml?

abosio commented 6 years ago

I think this is related.

We updated a 5.1b3 site to 5.1, purged retina_scales from the registry and added highpixeldensity_scales and we get AttributeError for retina_scales when loading our pages: retina-scales-error.txt

Using scales.tag(...) does not fix.

mauritsvanrees commented 6 years ago

@mrsaicharan1 No that would not be enough, and also not necessary. We need an upgrade step in plone.app.upgrade. That is always tricky to get right. I made a PR for this. You can have a look if you want: https://github.com/plone/plone.app.upgrade/pull/152

@abosio: Did you override the version pin for plone.namedfile? http://dist.plone.org/release/5.1/versions.cfg pins it to 4.2.4, which as far as I can see cannot lead to the traceback you see.

hvelarde commented 6 years ago

I was thinking the same; I also took a look at the code and saw no traces of that attribute.