getVersionableContentTypes for upgraded Plone sites?

Have you seen this before? A Plone 5.2.1 site with Python 2.7.15 was upgraded from Plone 4.x. In the view @@historyview for a page (Document), version changes do not show up.

Stepping through Products.CMFEditions-3.3.3-py2.7.egg/Products/CMFEditions/ the isVersionable() method,

(Pdb) pp self.getVersionableContentTypes()
[u'ATDocument', u'ATNewsItem']
(Pdb) obj.portal_type

How best to correct the list of types returned by getVersionableContentTypes() to reflect the Dexterity content type names?

I see I could total haxx0r it by calling setVersionableContentTypes()... but that seems bugly

You can set the versioning policy for each content type in @@content-controlpanel (or repositorytool.xml in GenericSetup)

Ahhhh, thanks David :slight_smile: Yes, a versioning policy was needed, not just the behavior being enabled. I set it to automatic for "Page" (lol, so many names for the same thing) and I now see version changes showing up in the view.


In summary:

  1. The Versionable behavior needs to be enabled for the content type, in SITEURL/dexterity-types/Document/@@behaviors (in my case it was already checked)

  2. In my case I had to set the versionable content types explicitly using a PDB debug prompt, after starting the client with the environment variable PLONE_CSRF_DISABLED=true (otherwise Plone rejects the change).

(Pdb) self.setVersionableContentTypes([u'ATDocument', u'ATNewsItem', u'Document'])
(Pdb) self.getVersionableContentTypes()
[u'ATDocument', u'ATNewsItem', u'Document']
  1. Set the versioning policy for the content type.

Is this something overlooked in the Archetypes -> Dexterity migration code? I'd like to fix or at least leave some warning for others (or myself, later).