Some hands-on advice how to work on portlets in Plone 3.4 and 4.1.
Most portlets use the "cmf.ManagePortal" permission to edit a portlet. The startup code of Zope (application server which Plone is based on) has changed to some degree in Zope 2.13 and there might be some code that no longer works - if it depended on specific import time and ZCML configuration ordering. In Plone 4 you generally need to be more explicit about your ZCML dependencies. If you use the the cmf.ManagePortal permission, you can either do an
Example (conifigure.zcml of fourdigits.portlet.twitter, which is in the collective):
<include package="Products.CMFCore"
file="permissions.zcml" />
I've found out that this works well for Plone 4 and Plone 4.1 but this breaks on older Plone 3 installations, due to refactoring of Plone/CMFCore. There is a solution to this called to make this more conditional, called: "zcml:condition". If you add a zcml:condition to 'detect' Plone 4.1 it will work in Plone 3, Plone 4 and Plone 4.1. Example:
<include package="Products.CMFCore"
zcml:condition="have plone-41"
file="permissions.zcml" />
Enjoy!