Skip to content

Fix portlet assignment#3

Open
ddellaquila wants to merge 1 commit intocollective:masterfrom
k-gigas:master
Open

Fix portlet assignment#3
ddellaquila wants to merge 1 commit intocollective:masterfrom
k-gigas:master

Conversation

@ddellaquila
Copy link

This fix makes page work even if a portlet that was provided by a third party add-on is no longer available, and logs about such problems into the event log.

After removing an add-on we got this error in one of the website pages:

...
File "/opt/plone/buildout-cache/eggs/Solgema.PortletsManager-0.7-py2.7.egg/Solgema/PortletsManager/portlets/retriever.py", line 103, in getPortlets
assigned = ISolgemaPortletAssignment(assignment)
TypeError: ('Could not adapt', <persistent broken collective.portlet.adsense.adsenseportlet.Assignment instance '\x00\x00\x00\x00\x00(\xa8\x98'>, <InterfaceClass Solgema.PortletsManager.interfaces.ISolgemaPortletAssignment>)

To fix it I used a similar approach used in https://github.com/vipod/collective.braveportletsmanager to fix https://dev.plone.org/ticket/7375 but without the 'delete portlet' part.

    This fix makes page work even if a portlet that was
    provided by a third party add-on is no longer available,
    and logs about such problems into the event log.
@afrepues
Copy link

@ddellaquila is the broken portlet visible in the portlet manager with this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants