Ticket #7408 (closed Bug: fixed)

Opened 4 years ago

Last modified 4 years ago

plone.app.i18n.locales.languageselector does not show up in portal_view_customizations tool

Reported by: kteague Owned by: witsch
Priority: minor Milestone: 3.0.4
Component: Infrastructure Keywords:
Cc: hannosch

Description

The plone.app.customerize.templateViewRegistrations function decides what is available in the view customizations tool.

This can be fixed by changing the name of the class to end with the word 'Viewlet'. Although that could break existing add-ons and customizations. One could check for 'IViewlet.implementedBy(factory)' although maybe that brings in unwanted Viewlets? Or perhaps add a special case just for the LanguageSelector? Or finally 'fix it right' as suggested by the TODO ...

# TODO: this should really be dealt with using # a marker interface on the view factory

Change History

comment:1 Changed 4 years ago by hannosch

  • Owner changed from somebody to witsch
  • Cc hannosch added

Assigning to Mr. Customerize :)

comment:2 Changed 4 years ago by witsch

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

(In [18327]) the name of customerizable viewlets should not have to end in "Viewlet" ?\226?\128?\148 they should also be picked up when implementing "IViewlet" (fixes #7408)

comment:3 in reply to: ↑ description Changed 4 years ago by witsch

Replying to kteague:

This can be fixed by changing the name of the class to end with the word 'Viewlet'. Although that could break existing add-ons and customizations.

that would just be a (imho bad) workaround.

One could check for 'IViewlet.implementedBy(factory)' although maybe that brings in unwanted Viewlets?

nope, it doesn't — the diff of the registration info before and after r18327 is

  • regs

     
    434434            {'customized': None, 
    435435             'for': 'zope.interface.Interface', 
     436             'type': 'plone.app.layout.viewlets.interfaces.IPortalTop', 
     437             'viewname': u'plone.app.i18n.locales.languageselector', 
     438             'zcmlfile': 'plone.app.i18n.locales.browser/configure.zcml', 
     439             'zptfile': 'plone.app.i18n.locales.browser/languageselector.pt'}, 
     440            {'customized': None, 
     441             'for': 'zope.interface.Interface', 
    436442             'type': 'plone.app.layout.viewlets.interfaces.IBelowContentBody', 
    437443             'viewname': u'plone.belowcontentbody.workflowhistory', 

so it only adds the language selector, but then again more missing viewlets would have been most welcome, of course... :)

Or finally 'fix it right' as suggested by the TODO ...

yes, it really should be done like this, but that has to wait a little longer. for 3.0.4 the quick fix from r18327 will have to do...

many thanks for reporting & also the hints on how to fix it, though. much appreciated! :)

Note: See TracTickets for help on using tickets.