Commit ec5bc1e3 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Category Tool and Base Category portal types were missing

BaseAccessorHolder in their bases, thus related accessors were not
properly generated



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43121 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 713872c5
...@@ -111,8 +111,6 @@ class AccessorHolderType(type): ...@@ -111,8 +111,6 @@ class AccessorHolderType(type):
InitializeClass(accessor_holder_class) InitializeClass(accessor_holder_class)
return accessor_holder_class return accessor_holder_class
generating_base_accessor_holder = False
def _generateBaseAccessorHolder(portal, def _generateBaseAccessorHolder(portal,
accessor_holder_module): accessor_holder_module):
""" """
...@@ -136,15 +134,9 @@ def _generateBaseAccessorHolder(portal, ...@@ -136,15 +134,9 @@ def _generateBaseAccessorHolder(portal,
if accessor_holder is not None: if accessor_holder is not None:
return accessor_holder return accessor_holder
global generating_base_accessor_holder # When setting up the site, there will be no portal_categories
if generating_base_accessor_holder:
# can cause recursion, as accessing categories generates category properties
return None
generating_base_accessor_holder = True
portal_categories = getattr(portal, 'portal_categories', None) portal_categories = getattr(portal, 'portal_categories', None)
if portal_categories is None: if portal_categories is None:
generating_base_accessor_holder = False
return None return None
base_category_list = portal_categories.objectIds() base_category_list = portal_categories.objectIds()
...@@ -163,7 +155,6 @@ def _generateBaseAccessorHolder(portal, ...@@ -163,7 +155,6 @@ def _generateBaseAccessorHolder(portal,
'erp5.accessor_holder', 'erp5.accessor_holder',
initialize=False) initialize=False)
setattr(accessor_holder_module, base_accessor_holder_id, accessor_holder) setattr(accessor_holder_module, base_accessor_holder_id, accessor_holder)
generating_base_accessor_holder = False
return accessor_holder return accessor_holder
def _generatePreferenceToolAccessorHolder(portal, accessor_holder_list, def _generatePreferenceToolAccessorHolder(portal, accessor_holder_list,
...@@ -212,4 +203,3 @@ def _generatePreferenceToolAccessorHolder(portal, accessor_holder_list, ...@@ -212,4 +203,3 @@ def _generatePreferenceToolAccessorHolder(portal, accessor_holder_list,
initialize=False) initialize=False)
setattr(accessor_holder_module, 'PreferenceTool', accessor_holder) setattr(accessor_holder_module, 'PreferenceTool', accessor_holder)
return accessor_holder return accessor_holder
...@@ -70,11 +70,8 @@ def _createAccessorHolderList(site, ...@@ -70,11 +70,8 @@ def _createAccessorHolderList(site,
accessor_holder_list = [] accessor_holder_list = []
if "Base" in property_sheet_name_set: if "Base" in property_sheet_name_set:
accessor_holder_class = None
# useless if Base Category is not yet here or if we're currently # useless if Base Category is not yet here or if we're currently
# generating accessors for Base Categories # generating accessors for Base Categories
if hasattr(erp5.accessor_holder, "BaseCategory"):
accessor_holder_class = _generateBaseAccessorHolder(site, accessor_holder_class = _generateBaseAccessorHolder(site,
erp5.accessor_holder) erp5.accessor_holder)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment