@hvelarde you're correct that the transforms tool caches installed transforms. I've used this in the past to remove an old kupu transform (html_to_captioned) from the transforms tool on a debug prompt: (backup first, verify on a copy of your instance, etc., the usual disclaimers)
from StringIO import StringIO
from Products.PortalTransforms.setuphandlers import correctMapping
out = StringIO()
correctMapping(out, app.plone)
out.getvalue()
'have to unmap transform (html-to-captioned) cause its not in portal_transforms ...\n...ok\n'
I had @keul's and similar several years ago too in a bunch of sites after upgrading massive customized sites (not sure exactly which versions and addons). Fastest solution was to delete whole portal_transform, create a blank plone site in parallel and copy over the tool from there into the migrated site.
I think I finally found why deleting broken transform stopped working, and probably this fix the @hvelarde issue too, and every other issue similar to this ones.
<rant-mode>
Sometimes I really like the idea to find a DeLorean, go back in time at the moment when we started adding persistent utility and using the component registry and say "I'm a time traveller that came from a dark future. Don't do this, is a bad idea".
</rant-mode>
So, I found I was not able to create new Poi issues due to ValueError: Unknown mime type text/x-web-intelligent.
I found that the mimetype_registry I have was a lot different than on from a whole new site + Poi.
One time again: deleted the tool from my site and copied one from a test site.
Now is easy to get why. We have a persistent utility that is someway different from the tool object (probably because those tools implements a cache? I don't know).
Fix this is easy: just rerun the "Local Component Registry" import step of Products.MimeTypesRegistry.
After this I was pretty sure that portal_transforms tool was hit by the same issue.
After a rerun of Local Component Registry of Products.PortalTransforms my startup warnings disappeared, I can create Poi issues and the Sun is shining in the sky.
Not 100% clear to me (as I said, it's probably related to the cache). However: rerunning the component registry import step refresh (destroy and re-create) the persistent utility.
If you look at the implementation of getToolByName you'll see it try first load a named utility. Someway the utility and the portal tool are different.
@keul, I'm trying to follow these steps...
Can you give me a hint where to find / do these?
Tried:
def unregister_transform(name):
portal = api.portal.get()
transforms = getToolByName(portal, 'portal_transforms')
result = ""
try:
try:
transforms.unregisterTransform(name)
except MimeTypeException:
if name in transforms.objectIds():
transforms._delObject(name)
result = ("Removed transform %s" % name)
except AttributeError:
result = ("Could not remove transform %s (not found)" % name)
return result
^ As an upgrade step: This seems useful - no BROKEN items now in portal_transformations, but the error still appears after restarting the instance. Started to search for a solution, then found this topic.
Then tried:
ZMI -> portal_transformations -> Reload transforms (manage_reloadAllTransforms) (the errors still here)
in portal_setup - Upgrades a see no profile for Products.MimeTypesRegistry, so I can't rerun upgrade steps... / The same for PortalTransforms.
I expect it is easy, but I just can't get it. Please help.
Oh, I found them in ZML -> portal_setup -> Advanced import.
I tried:
import without including dependencies of the step -> the errors still here
import including dependencies -> still not solved
The log on import:
2018-10-01 14:31:06 WARNING GenericSetup.toolset Not creating required tool portal_ploneboard, because class Products.Ploneboard.PloneboardTool is not found.
2018-10-01 14:31:06 INFO GenericSetup.toolset Toolset imported.
2018-10-01 14:31:06 INFO GenericSetup.componentregistry Adapters registered.
2018-10-01 14:31:06 INFO GenericSetup.componentregistry Utilities registered.
2018-10-01 14:31:41 WARNING GenericSetup.toolset Not creating required tool portal_ploneboard, because class Products.Ploneboard.PloneboardTool is not found.
2018-10-01 14:31:41 INFO GenericSetup.toolset Toolset imported.
2018-10-01 14:31:41 INFO GenericSetup.componentregistry Adapters registered.
2018-10-01 14:31:41 INFO GenericSetup.componentregistry Utilities registered.
My errors that I want to solve:
2018-10-01 14:33:44 ERROR PortalTransforms Cannot register transform text_to_emoticons (ImportError), using BrokenTransform: Error
No module named Ploneboard.transforms.text_to_emoticons
2018-10-01 14:33:44 ERROR PortalTransforms Cannot register transform url_to_hyperlink (ImportError), using BrokenTransform: Error
No module named Ploneboard.transforms.url_to_hyperlink