I have a plone 4.x site, which I migrated to plone 6 using collective.exportimport. Both sites are buildout based and using the classic UI. I also had a custom add-on which defined pretty much all the content types that were migrated, so before the migration I uplifted the custom add-on to use python3.x and latest plone modules.
After the migration I have noticed all content type icons are not rendering, neither in my /folder_contents directory nor in any of my widgets/ portlets.
The content types were already dexterity based, therefore I assume no changes were needed. This is how their xml is defined within my profiles/default/types directory:
<?xml version="1.0"?>
<object name="mytype" meta_type="Dexterity FTI" i18n:domain="plone"
xmlns:i18n="http://xml.zope.org/namespaces/i18n">
<property name="title" i18n:translate="">Group</property>
<property name="description" i18n:translate="">My type.</property>
<property name="icon_expr">string:${portal_url}/++resource++my.addon/images/mytype.png</property>
The interesting part is that if I navigate to:
http://localhost/MyPlone/++resource++my.addon/images/mytype.png
I can see the rendered icon correctly. It also works if I navigate from the root rather than from my plone site.
Within the logs, I can see lots of
[Products.CMFPlone.browser.icons:100][waitress-0] Icon resolver lookup of 'http:' failed, fallback to Plone icon.
So a quick google and came across a bunch of posts:
This PR looked promising, and since it was open I thought i'll try to implement the changes myself. Nothing changed however.
This post seemed like a similar problem.
I tried the suggestion of updating my registry.xml formy custom add-on with the record:
<record name="plone.icon.contenttype/MyNewContentType">
<field type="plone.registry.field.TextLine">
<title>MyNewContentType content type icon</title>
</field>
<value key="resource">++plone++bootstrap-icons/MyBootstrapIcon.svg</value>
</record>
And that worked for icons for my portlets/ widgets! However, the when navigating to /folder_contents, not only did I not see them rendered, but I am receiving the following error:
raceback (innermost last):
Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 390, in publish_module
Module ZPublisher.WSGIPublisher, line 284, in publish
Module ZPublisher.mapply, line 98, in mapply
Module ZPublisher.WSGIPublisher, line 68, in call_object
Module Products.CMFPlone.browser.icons, line 78, in __call__
TypeError: Resource.__call__() got an unexpected keyword argument 'REQUEST'
Not too sure where to go from here. Looking in ZMI -> portal_types the properties have been pulled appropriately from the xml. The icon expression is defined as:
string:${portal_url}/++resource++my.addon/images/mytype.png
Would appreciate any help