Attention

This document was written for an unsupported version of Plone, Plone 2.5.x, and was last updated 1604 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

AttributeError: toPortalTime

by Rene Pijlman last modified Dec 30, 2008 03:08 PM
In Plone 2.1.2 or 2.5 you get an error message: AttributeError: toPortalTime

In Plone 2.1.2, toPortalTime (that had been marked as deprecated for a while) was replaced with toLocalizedTime, causing products and customizations that use the old name to raise this error.

This should not happen in a minor release, so toPortalTime was re-introduced in Plone 2.1.3. As a quick fix for this problem you can upgrade to Plone 2.1.3, or copy the toPortalTime.py file of 2.1.3 into a custom skin.

We do recommend, however, that you change all calls from toPortalTime to toLocalizedTime. toPortalTime is still deprecated in Plone 2.1, and it was removed in Plone 2.5.

When you encounter this error in Plone 2.5, it's probably caused by a product that hasn't been upgraded for Plone 2.5. Check the product's requirements and supported releases, and notify its maintainer of the problem. You may be able to work around the problem by copying the toPortalTime.py file of Plone 2.1.3 into a custom skin, but you should be prepared to deal with other compatibility problems of the product as well.