From 045eae06333c8b81babd5c67a73f67725acada5f Mon Sep 17 00:00:00 2001 From: Fabien Morin <fabien@nexedi.com> Date: Tue, 30 Mar 2010 15:49:08 +0000 Subject: [PATCH] (multi)membership_criterion_base_category_list cannot be get on the context, use the request instead git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34214 20353a03-c40f-0410-a6d1-a30d3c3de9de --- ...redicate_validateMembershipCriterionDocument.xml | 13 ++++++++++--- product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Predicate_validateMembershipCriterionDocument.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Predicate_validateMembershipCriterionDocument.xml index dd3ca4f1e7..9f3c9c651e 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Predicate_validateMembershipCriterionDocument.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Predicate_validateMembershipCriterionDocument.xml @@ -53,8 +53,13 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>category_list = context.getMembershipCriterionBaseCategoryList()\n -category_list += [i for i in context.getMultimembershipCriterionBaseCategoryList() \\\n + <value> <string>category_list = request.get(\'field_my_membership_criterion_base_category_list\', [])\n +if not same_type(category_list, []):\n + category_list = [category_list]\n +multimembership_criterion_base_category_list = request.get(\'field_my_multimembership_criterion_base_category_list\', [])\n +if not same_type(multimembership_criterion_base_category_list, []):\n + multimembership_criterion_base_category_list = [multimembership_criterion_base_category_list]\n +category_list += [i for i in multimembership_criterion_base_category_list \\\n if i not in category_list]\n portal_categories = context.getPortalObject().portal_categories\n \n @@ -103,13 +108,15 @@ return 1\n <string>item_list</string> <string>request</string> <string>_getattr_</string> - <string>context</string> <string>category_list</string> + <string>same_type</string> + <string>multimembership_criterion_base_category_list</string> <string>_inplacevar_</string> <string>append</string> <string>$append0</string> <string>_getiter_</string> <string>i</string> + <string>context</string> <string>portal_categories</string> <string>item</string> <string>base_category</string> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 3ef08c825d..75fe09e0ee 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -1541 \ No newline at end of file +1544 \ No newline at end of file -- 2.30.9