Bug #34844
crash action "formulaire" de workflow / conditions (sur préremplissage)
Début:
15 juillet 2019
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
Exception: type = '<type 'exceptions.AttributeError'>', value = ''NoneType' object has no attribute 'set_value'' Stack trace (most recent call first): File "/usr/lib/python2.7/dist-packages/wcs/wf/form.py", line 189, in fill_form 187 v = None 188 if v: > 189 form.get_widget('f%s' % field.id).set_value(v) 190 req.form['f%s' % field.id] = v 191 locals: displayed_fields = [<wcs.fields.TitleField object at 0x7ff50819a0d0>, <wcs.fields.CommentField object at 0x7ff50819a990>] field = <wcs.fields.ItemField object at 0x7ff50819af90> form = <wcs.qommon.form.Form object at 0x7ff5021f5350> formdata = <Rdv_Ada "Prise de rendez-vous pour le d\xc3\xa9p\xc3\xb4t d'une attestation d'accueil - n\xc2\xb061-326" id:326> kwargs = {} prefill_user = None req = <wcs.compat.CompatHTTPRequest instance at 0x7ff50202e638> self = <wcs.wf.form.FormWorkflowStatusItem object at 0x7ff50819a1d0> user = <SqlUser 'Nicole LIVOLSI' id:109> v = 'Monsieur' verified = False File "/usr/lib/python2.7/dist-packages/wcs/workflows.py", line 1419, in get_action_form 1417 if not item.check_condition(filled): 1418 continue > 1419 item.fill_form(form, filled, user, displayed_fields=displayed_fields) 1420 1421 for action in filled.formdef.workflow.get_global_actions_for_user(filled, user):
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a presque 5 ans
- Fichier 0001-workflows-don-t-prefill-fields-that-were-conditioned.patch 0001-workflows-don-t-prefill-fields-that-were-conditioned.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a presque 5 ans
- Statut changé de Solution proposée à Solution validée
Comme tu fais un for sur displayed_fields et que par défaut displayed_fields=None, je verrais bien un « for field in displayed_fields or []:
», histoire de se protéger contre un cas que je ne vois pas arriver mais bon.
Et avec ça, c'est un ack.
Mis à jour par Frédéric Péters il y a presque 5 ans
- Fichier 0001-workflows-don-t-prefill-fields-that-were-conditioned.patch 0001-workflows-don-t-prefill-fields-that-were-conditioned.patch ajouté
- Statut changé de Solution validée à Solution proposée
Plutôt il me semble prendre self.formdef.fields si jamais displayed_fields est None (mais pas si c'est liste vide).
Mis à jour par Frédéric Péters il y a presque 5 ans
- Fichier 0001-workflows-don-t-prefill-fields-that-were-conditioned.patch 0001-workflows-don-t-prefill-fields-that-were-conditioned.patch ajouté
Oui bien sûr.
Mis à jour par Thomas Noël il y a presque 5 ans
- Statut changé de Solution proposée à Solution validée
let's go
Mis à jour par Frédéric Péters il y a presque 5 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit b9db059a473d46a066957956f641fa327047e20f Author: Frédéric Péters <fpeters@entrouvert.com> Date: Mon Jul 15 14:02:58 2019 +0200 workflows: don't prefill fields that were conditioned out (#34844)
Mis à jour par Frédéric Péters il y a presque 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
workflows: don't prefill fields that were conditioned out (#34844)