How to fix “AttributeError: _v_transform” view errors on migrated Plone sites.
After migrating a test instance of a non-buildout Plone v3.1.7 site to a new buildout installation of Plone 3.2.1, None of my Page (or Document) objects, including the home page of the site, were viewable. All view attempts triggered Python tracebacks like the following:
Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish ... Module zope.tales.tales, line 696, in evaluate ... Module Products.Archetypes.Field, line 1391, in get Module Products.Archetypes.BaseUnit, line 100, in transform Module Products.PortalTransforms.TransformEngine, line 181, in convertTo Module Products.PortalTransforms.chain, line 51, in convert Module Products.PortalTransforms.Transform, line 192, in convert AttributeError: _v_transform
See a more detailed error example here.
As the traceback says, this is clearly a problem with PortalTransforms. A post on the PSU WebLion wiki claimed this error could be solved by deleting any “broken” transformations in the Contents and Policy tabs of the ZMI portal_transforms tool. While this may be worth trying, I had no transformations marked as “broken” in my case.
Luckily, Raphael Ritz offered some advice on transform tool errors after migration, and how to fix such problems:
- In the ZMI, navigate to /portal_setup, and click the Import tab.
- Under Select Profile or Snapshot, from the drop-down menu, select PortalTransforms.
- A new PortalTransforms setup entry will have been added to the list of many importable objects; in my case, it was added all the way down the list as #33, so you may have to search for yours.
Once you find this PortalTransforms setup entry, select the check-box in front of it.
- At the bottom of the page, leave Include Dependencies? selected, and then click Import selected steps.
After a few seconds, you should receive a message to confirm that the step has been imported, and your page views should be viewable once again.