You are here: Home / Documentation / How To's / How to remove broken Marker Interfaces

How to remove broken Marker Interfaces

by hietpasd published Sep 17, 2012 02:38 PM, last modified Aug 16, 2016 10:50 AM
This is a simple way to purge any broken, dead, left behind, or changed marker interfaces from any object.

DO THIS FIRST ON YOUR TEST SERVER OR LOCAL INSTANCE!  MAKE SURE TO BACKUP YOUR SITE.

Create the following code in blue a file called removeInterface.py in your Extensions folder shown in the paths below.  (Create a Extensions folder if one doesn't exist.)

/plone/parts/client1/Extensions/

/plone/parts/instance/Extensions/

 

Extension Folders: removeInterface.py

If Interface already exists in the code somewhere:

from Products.Five.utilities.marker import erase
from your.product.browser.interfaces import yourinterface

def removeInterface(self):
    try:
        erase(self,yourinterface)
    except Exception as e:
        return "ERROR: " + str(e)
    return "Done"

If Interface doesn't exist in the code, you should be able do something similar to the above code.  You may need to make a temporary interface with the same name as the bad interface as a place holder and inject it into the module.

 

External Method

Create a External Method in the ZMI with the following.

ID: removeInterface

Title:

Module: removeInterface

Function: removeInterface

 

Remove the offending Interface

Go to the offending object's url and append /removeInterface (http://www.yoursite.com/Plone/folder/offending-object/removeInterface)

 

Navigation