Ticket #8906 (closed Bug: fixed)

Opened 8 years ago

Last modified 4 years ago

plone.app.layout.icons fails on uninstalled content types.

Reported by: sergey_v Owned by:
Priority: minor Milestone: 3.3.x
Component: General Version: 4.1
Keywords: Cc:


If a folder contains an instance of a content type which product was uninstalled using QuickInstaller (but not removed from the filesystem), an attempt to view folder contents produces "AttributeError: 'NoneType' object has no attribute 'Title'", which is caused by the fact that plone.app.layout.icons.icons trying to access an FTI object in portal_types which doesn't exist (has been removed by QuickInstaller)

How to reproduce:

  1. Install any third-party product which registers a new content type (e.q. PloneArticle)
  2. Create an object of that type
  3. Uninstall the product using Add/Remove Products configlet
  4. Try to view the contents of the folder containing the object.

How to fix:

The exception is raised at line 52 of plone.app.layout.icons.icons.py:

return tt.get(self.brainportal_type?).Title()

The code needs to check if the value returned by tt.get() us not None and only then try to call Title() function

Change History

comment:1 Changed 8 years ago by sergey_v

A similar pattern is used in plone.app.layout.icons.icons.CMFContentIcon.description (line 80) - I suppose it also may cause an error in similar circumstances.

comment:2 Changed 7 years ago by hannosch

  • Component changed from Unknown to Infrastructure

comment:3 Changed 4 years ago by kleist

  • Status changed from new to closed
  • Version set to 4.1
  • Resolution set to fixed

comment:4 Changed 4 years ago by davisagli

  • Component changed from Infrastructure to General
Note: See TracTickets for help on using tickets.