collective / lineage.registry

plone.app.registry for Lineage subsites. It adds a local component with a layered proxy registry.
Other
1 stars 4 forks source link

Renaming a Folder marked as childsite results in AttributeError #3

Open frisi opened 10 years ago

frisi commented 10 years ago

create a folder named 'some-folder' mark it as childsite rename the folder to 'another-folder'

accessing the folder results in the following error

       'view': <Products.Five.metaclass.SimpleViewClass from eggs/plone.app.content-2.1.4-py2.7.egg/plone/app/content/browser/folder_contents.pt object at 0x7f9040bd9f90>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f90495b2790>}
  Module zope.contentprovider.tales, line 77, in __call__
  Module zope.viewlet.manager, line 112, in update
  Module zope.viewlet.manager, line 118, in _updateViewlets
  Module plone.app.layout.links.viewlets, line 122, in update
  Module Products.CMFPlone.browser.syndication.utils, line 47, in context_enabled
  Module zope.component.hookable, line 33, in __call__
  Module zope.component.hooks, line 104, in adapter_hook
  Module Products.CMFPlone.browser.syndication.settings, line 27, in __init__
  Module zope.component._api, line 166, in getUtility
  Module zope.component._api, line 172, in queryUtility
  Module zope.component.registry, line 163, in queryUtility
  Module five.localsitemanager.registry, line 56, in _uncached_lookup
  Module five.localsitemanager.registry, line 123, in _wrap
  Module OFS.Traversable, line 285, in unrestrictedTraverse
   - __traceback_info__: (['lineage_registry'], 'some-folder')
AttributeError: some-folder

using collective.lineage master (2.0-refactor branch commits included) lineage.themeselection master lineage.registry 1.2

cillianderoiste commented 5 months ago

I got a similar error and was able to work around it:

from collective.lineage.utils import enable_childsite
from collective.lineage.utils import disable_childsite
disable_childsite(a_folder)
enable_childsite(a_folder)

The values in the registry weren't lost.