From 3cdcdec9455ba0105b8435ff7fd4ab52a01fd72e Mon Sep 17 00:00:00 2001
From: Kevin Deldycke <kevin@nexedi.com>
Date: Mon, 12 Jun 2006 14:37:17 +0000
Subject: [PATCH] Revert changes (mistake: I was reading the diff in the wrong
 order...)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7702 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_catalog/erp5_mysql/z0_drop_fulltext.xml  |  2 +-
 .../erp5_mysql/z0_uncatalog_fulltext.xml            |  4 ++--
 .../erp5_mysql/z_catalog_fulltext_list.xml          |  6 +++---
 .../portal_catalog/erp5_mysql/z_create_fulltext.xml |  2 +-
 .../portal_skins/erp5_web/WebSite_clone.xml         |  3 ---
 .../portal_skins/erp5_web/WebSite_getBreadcrumb.xml | 13 ++++++++-----
 .../erp5_web/WebSite_getDocumentUrl.xml             |  3 ++-
 .../portal_skins/erp5_web/WebSite_getListboxUrl.xml |  3 ++-
 .../portal_skins/erp5_web/WebSite_getSection.xml    |  2 +-
 .../erp5_web/WebSite_viewSearchResult.xml           |  6 +++---
 10 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_drop_fulltext.xml b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_drop_fulltext.xml
index 3eae4cf752..9deba222a6 100644
--- a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_drop_fulltext.xml
+++ b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_drop_fulltext.xml
@@ -81,7 +81,7 @@
         </item>
         <item>
             <key> <string>connection_id</string> </key>
-            <value> <string>erp5_sql_connection</string> </value>
+            <value> <string>erp5_sql_deferred_connection</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_uncatalog_fulltext.xml b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_uncatalog_fulltext.xml
index 75307b5f5e..b1af42d6bb 100644
--- a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_uncatalog_fulltext.xml
+++ b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z0_uncatalog_fulltext.xml
@@ -45,7 +45,7 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>uid</string>
+<string>uid</string>
                           </list>
                         </value>
                     </item>
@@ -90,7 +90,7 @@
         </item>
         <item>
             <key> <string>connection_id</string> </key>
-            <value> <string>erp5_sql_connection</string> </value>
+            <value> <string>erp5_sql_deferred_connection</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_catalog_fulltext_list.xml b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_catalog_fulltext_list.xml
index fbb3f2f7de..aae4a3c434 100644
--- a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_catalog_fulltext_list.xml
+++ b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_catalog_fulltext_list.xml
@@ -51,8 +51,8 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>uid</string>
-                            <string>SearchableText</string>
+<string>uid</string>
+<string>SearchableText</string>
                           </list>
                         </value>
                     </item>
@@ -98,7 +98,7 @@ SearchableText</string> </value>
         </item>
         <item>
             <key> <string>connection_id</string> </key>
-            <value> <string>erp5_sql_connection</string> </value>
+            <value> <string>erp5_sql_deferred_connection</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_create_fulltext.xml b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_create_fulltext.xml
index 07352e3aa0..005b4aff58 100644
--- a/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_create_fulltext.xml
+++ b/bt5/erp5_web/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_create_fulltext.xml
@@ -87,7 +87,7 @@
         </item>
         <item>
             <key> <string>connection_id</string> </key>
-            <value> <string>erp5_sql_connection</string> </value>
+            <value> <string>erp5_sql_deferred_connection</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_clone.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_clone.xml
index 584c0554c0..d3ed5af439 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_clone.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_clone.xml
@@ -79,11 +79,8 @@ dest = directory[paste_result[0][\'new_id\']]\n
 #if id is not None:\n
 #  directory.manage_renameObject(id=dest.getId(),new_id=id)\n
 \n
-context.log(\'WebSite_clone\', context.REQUEST.form)\n
-\n
 for (key, val) in context.REQUEST.form.items():\n
   if key != \'id\' and dest.hasProperty(key):\n
-    context.log(\'WebSite_clone\',\'overwriting attr "%s" to value "%s"\' % (key,val))\n
     dest.setProperty(key, val)\n
 \n
 return context.REQUEST.RESPONSE.redirect(\'%s/%s\' % (directory.WebSite_getUrl(), dest.getId()))\n
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml
index 637adec397..603f53916f 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml
@@ -73,11 +73,11 @@
 html_list = []\n
 \n
 for crumb in context.WebSite_getBreadcrumbValue():\n
-  if crumb.getTitle() is None or crumb.getTitle() == \'\':\n
-    text = crumb.getId()\n
-  else:\n
-    text = crumb.getTitle()\n
-  html_list.append(\'<a href="%s">%s</a>\' % (crumb.WebSite_getUrl(), text))\n
+ text = None\n
+ for property in (\'title\', \'short_title\', \'id\'):\n
+   if text in (None, \'\') and hasattr(crumb, property):\n
+    text = getattr(crumb, property)\n
+ html_list.append(\'<a href="%s">%s</a>\' % (crumb.WebSite_getUrl(), text))\n
 \n
 return \' &gt; \'.join(html_list)\n
 
@@ -129,6 +129,9 @@ return \' &gt; \'.join(html_list)\n
                             <string>crumb</string>
                             <string>None</string>
                             <string>text</string>
+                            <string>property</string>
+                            <string>hasattr</string>
+                            <string>getattr</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml
index 7775ef1a87..76407208cf 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml
@@ -93,7 +93,7 @@ return context.WebSite_getUrl()\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string></string> </value>
+            <value> <string>**kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -119,6 +119,7 @@ return context.WebSite_getUrl()\n
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
+                            <string>kw</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>document</string>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getListboxUrl.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getListboxUrl.xml
index 01c4e1b355..6daa15626f 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getListboxUrl.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getListboxUrl.xml
@@ -72,7 +72,7 @@
 if brain is not None:\n
   o = brain.getObject()\n
   url = \'%s/%s\' % (context.REQUEST[\'URL1\'], o.getRelativeUrl())\n
-  if context.REQUEST.has_key(\'editable_mode\') and context.REQUEST[\'editable_mode\']:\n
+  if getattr(context.REQUEST, \'editable_mode\', None):\n
     url = \'%s/view?editable_mode=%s\' % (url, context.REQUEST[\'editable_mode\'])\n
 return url\n
 </string> </value>
@@ -129,6 +129,7 @@ return url\n
                             <string>o</string>
                             <string>_getitem_</string>
                             <string>context</string>
+                            <string>getattr</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml
index 2e9b2d420d..7b5c61c1cf 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml
@@ -70,7 +70,7 @@
             <key> <string>_body</string> </key>
             <value> <string>section = context.WebSite_getSectionValue()\n
 if section is not None:\n
-  return section.getTitle()\n
+  return section.WebSite_getUrl()\n
 return None\n
 </string> </value>
         </item>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_viewSearchResult.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_viewSearchResult.xml
index 6e86601005..998233d0d0 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_viewSearchResult.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_viewSearchResult.xml
@@ -83,7 +83,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string></string> </value>
+            <value> <string>**kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -109,10 +109,10 @@
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
+                            <string>kw</string>
                             <string>_apply_</string>
                             <string>_getattr_</string>
-<string>context</string>
-                            <string>kw</string>
+                            <string>context</string>
                           </tuple>
                         </value>
                     </item>
-- 
2.30.9