Project

General

Profile

Bug #13870

panne sur liste à choix multiples : toujours à None

Added by Thomas Noël almost 7 years ago. Updated almost 7 years ago.

Status:
Fermé
Priority:
Immediat
Assignee:
Target version:
Start date:
04 November 2016
Due date:
% Done:

0%

Estimated time:
Patch proposed:
Yes
Planning:

Description

Un formulaire avec un champ liste à choix multiple, avec un nom de variable "xxx" : le form_var_xxx est à None même si un choix est coché.


Files


Related issues

Related to w.c.s. - Bug #13581: champ cases à cocher avec des libellés contenant des guillemetsFermé13 October 2016

Actions

Associated revisions

Revision 3623c0fb (diff)
Added by Thomas Noël almost 7 years ago

forms: don't modify "normal" keys in checkboxes widget (#13870)

History

#2

Updated by Thomas Noël almost 7 years ago

apparu entre v1.61 et v1.62

#3

Updated by Thomas Noël almost 7 years ago

apparu lors de 319e560 → #13581

#4

Updated by Thomas Noël almost 7 years ago

diff --git a/wcs/qommon/form.py b/wcs/qommon/form.py
index 6722777..3f529e0 100644
--- a/wcs/qommon/form.py
+++ b/wcs/qommon/form.py
@@ -1136,7 +1136,7 @@ class CheckboxesWidget(CompositeWidget):
         for i, option in enumerate(options):
             if len(option) == 2:
                 key, title = option[:2]
-                key = str(i)
             else:
                 _, title, key  = option[:3]

... mais je ne comprends pas encore bien #13581

#5

Updated by Thomas Noël almost 7 years ago

peut-être plutôt :

diff --git a/wcs/qommon/form.py b/wcs/qommon/form.py
index 6722777..e1b2579 100644
--- a/wcs/qommon/form.py
+++ b/wcs/qommon/form.py
@@ -1136,12 +1136,12 @@ class CheckboxesWidget(CompositeWidget):
         for i, option in enumerate(options):
             if len(option) == 2:
                 key, title = option[:2]
-                key = str(i)
+                name = 'element%d' % i
             else:
                 _, title, key  = option[:3]
+                name = 'element%s' % str(key)

             key = str(key)
-            name = 'element%s' % key

             element_kwargs = kwargs.copy()
             if self.options_with_attributes and option[-1].get('disabled'):

mais encore une fois, je ne mesure pas ce que je fais là.

#6

Updated by Thomas Noël almost 7 years ago

  • Related to Bug #13581: champ cases à cocher avec des libellés contenant des guillemets added
#7

Updated by Thomas Noël almost 7 years ago

  • Subject changed from liste à choix multiple => form_var_xxx à None to panne sur liste à choix multiples : toujours à None
  • Priority changed from Normal to Immediat

Je pose la priorité à "immédiat" car c'est un bogue présent en prod.

#8

Updated by Thomas Noël almost 7 years ago

(bien sûr, le test foire dans le patch).

#9

Updated by Thomas Noël almost 7 years ago

  • Private changed from No to Yes

Devant l'urgence, en essayant d'avoir un peu confiance en moi, j'ai posé ce patch en recette et en prod.

#10

Updated by Thomas Noël almost 7 years ago

  • Private changed from Yes to No
#11

Updated by Frédéric Péters almost 7 years ago

Ack.

#12

Updated by Thomas Noël almost 7 years ago

  • Status changed from En cours to Résolu (à déployer)
commit 3623c0fb4eb1e8c3e21bbf71149f8f1342dd7da9
Author: Thomas NOEL <tnoel@entrouvert.com>
Date:   Fri Nov 4 15:24:50 2016 +0100

    forms: don't modify "normal" keys in checkboxes widget (#13870)

#13

Updated by Frédéric Péters almost 7 years ago

  • Target version set to v1.64
#14

Updated by Frédéric Péters almost 7 years ago

  • Status changed from Résolu (à déployer) to Fermé

Also available in: Atom PDF