From 7ef80e657ec1c6526ba726d184d6477dce7e3cd3 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Tue, 20 Jun 2006 08:24:16 +0000
Subject: [PATCH] Do not pass selection_index to list_url, if it is None.
 Reported by Vincent Pelletier.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8075 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index 561f6182c9..a8be575a6d 100644
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -1998,8 +1998,10 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
     selection = self.getSelection()
     if list_method is not None:
       method_path = getPath(self.getContext()) + '/' + self.getListMethodName()
-      list_url = '%s?selection_name=%s&selection_index=%s' % \
-                   (self.getUrl(), self.getRequestedSelectionName(), self.getSelectionIndex())
+      list_url = '%s?selection_name=%s' % (self.getUrl(), self.getRequestedSelectionName())
+      selection_index = self.getSelectionIndex()
+      if selection_index is not None:
+        list_url += '&selection_index=%s' % selection_index
       selection.edit(method_path = method_path, list_url = list_url)
       self.getSelectionTool().setSelectionFor(self.getSelectionName(), selection, REQUEST = self.request)
 
-- 
2.30.9