[Erp5-report] r24922 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Dec 17 13:08:54 CET 2008
Author: jerome
Date: Wed Dec 17 13:08:48 2008
New Revision: 24922
URL: http://svn.erp5.org?rev=24922&view=rev
Log:
Detect and report wrong hierarchy in category spreadsheet
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.xml?rev=24922&r1=24921&r2=24922&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.xml [utf8] Wed Dec 17 13:08:48 2008
@@ -283,6 +283,24 @@
translateString("Duplicate id found: ${id}",\n
mapping=dict(id=element[\'value\'])))\n
\n
+ # Detect wrong hierarchy\n
+ if path_elements:\n
+ current_depth = element_depth\n
+ for element in path_elements[::-1]:\n
+ if element[\'depth\'] > current_depth:\n
+ break # we are now on another branch\n
+ if element[\'depth\'] == current_depth:\n
+ continue # we are on the same level\n
+ elif element[\'depth\'] == (current_depth - 1):\n
+ current_depth = element[\'depth\']\n
+ continue # we are on the direct parent (current level - 1)\n
+ else:\n
+ invalid_spreadsheet_error_handler(\n
+ translateString(\n
+ "Wrong hierarchy found for ID ${id} and depth ${depth}",\n
+ mapping=dict(id=path_element_id,\n
+ depth=element_depth)))\n
+ \n
# Save the path element\n
path_elements.append({ \'depth\': element_depth\n
, \'value\': path_element_id\n
@@ -396,6 +414,7 @@
<string>element</string>
<string>path</string>
<string>clean_title</string>
+ <string>current_depth</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=24922&r1=24921&r2=24922&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Wed Dec 17 13:08:48 2008
@@ -1,1 +1,1 @@
-1046
+1047
More information about the Erp5-report
mailing list