plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
255 stars 191 forks source link

Plone 5.1 file icons referenced with absolute path #2391

Closed mamoep closed 1 year ago

mamoep commented 6 years ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

  1. Install Plone 5.1 on RHEL7 install.sh --target=/test/plone5 --build-python zeo
  2. Create new Plone Site with default settings
  3. Add files like pdf, doc, xls
  4. Configure Apache 2.4 as reverse proxy RewriteRule ^/News($|/.*) http://localhost:9090/VirtualHostBase/https/%{SERVER_NAME}/Plone/VirtualHostRoot/_vh_News$1 [L,P]

What I expect to happen:

list view & table view of the Plone folder containing the files should show the file type icon

What actually happened:

Icons are broken. Apache Rewrite Rule doesn't work, because the icon is referenced with an absolute path, starting with /Plone 1ac9f9fae4179d4ca292c80bed281d85f8bff3ff

When I open the file, the icon is shown, as it is referenced relative there. Screenshot: plone51_mimetype_icon_2

Mimetype registry looks ok, example: 4237e0d907f0630f7a797b37780621b50ae3fc04

What version of Plone/ Addons I am using:

Plone 5.1 pas.plugins.ldap

mamoep commented 6 years ago

I tried to follow the code to find out more about this issue. plone.app.contenttypes uses tal:attributes="src item/MimeTypeIcon"> in the template showing the list. MimeTypeIcon function comes from plone.app.contentlisting. This function uses getNavigationRoot from plone.app.layout to create the path to the Mime Icon. I think the function MimeTypeIcon should use a different approach for URL lookup to get the correct absolute URL in virtual environments.

woolyseal commented 1 year ago

Probably resolved by commit https://github.com/plone/plone.app.contentlisting/pull/46, tests are ongoing