Bug #61255
crash vue des champs d'un formulaire/etc. quand un bloc de champs n'existe pas/plus
0%
Description
L'interface empêche normalement la situation d'arriver mais sur des exports/imports etc. il serait quand même appoprié de ne pas crasher,
Exception: type = '<class 'KeyError'>', value = '' Stack trace (most recent call first): File "/usr/lib/python3/dist-packages/wcs/qommon/storage.py", line 623, in get_filename 621 finally: 622 if fd: > 623 fd.close() 624 if cls._reset_class: 625 o.__class__ = cls locals: cls = <class 'wcs.blocks.BlockDef'> fd = None filename = '/var/lib/wcs/demarches-dev.villejuif.fr/blockdefs-slug/coordonnees_completes' ignore_errors = False ignore_migration = False kwargs = {} File "/usr/lib/python3/dist-packages/wcs/qommon/storage.py", line 559, in get_on_index 557 cls.rebuild_indexes() 558 filename = os.path.join(index_dir, str(fix_key(id))) > 559 return cls.get_filename(filename, ignore_errors=ignore_errors, ignore_migration=ignore_migration) 560 561 @classmethod locals: cls = <class 'wcs.blocks.BlockDef'> filename = '/var/lib/wcs/demarches-dev.villejuif.fr/blockdefs-slug/coordonnees_completes' id = 'coordonnees_completes' ignore_errors = False ignore_migration = False index = 'slug' index_dir = '/var/lib/wcs/demarches-dev.villejuif.fr/blockdefs-slug' objects_dir = '/var/lib/wcs/demarches-dev.villejuif.fr/blockdefs' File "/usr/lib/python3/dist-packages/wcs/fields.py", line 3377, in block 3375 if self._block: 3376 return self._block > 3377 self._block = BlockDef.get_on_index(self.type[6:], 'slug') 3378 return self._block 3379 locals: self = <BlockField 57 'Coordonnées du demandeur'> File "/usr/lib/python3/dist-packages/wcs/fields.py", line 3381, in get_type_label 3379 3380 def get_type_label(self): > 3381 return _('Field Block (%s)') % self.block.name 3382 3383 def fill_admin_form(self, form):
(regarder aussi au comportement en front sur la saisie d'un tel formulaire, etc.).
Fichiers
Demandes liées
Révisions associées
misc: display a technical error on form with removed fields (#61255)
Historique
Mis à jour par Frédéric Péters il y a environ 2 ans
- Lié à Development #61184: bloc de champs: interdire la modification du slug pour un bloc utilisé. ajouté
Mis à jour par Frédéric Péters il y a environ 2 ans
- Fichier 0002-misc-display-a-technical-error-on-form-with-removed-.patch 0002-misc-display-a-technical-error-on-form-with-removed-.patch ajouté
- Fichier 0001-backoffice-mark-missing-block-fields-in-list-of-fiel.patch 0001-backoffice-mark-missing-block-fields-in-list-of-fiel.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
0001 bateau pour l'admin, pas planter sur la liste des champs d'un formulaire(/autre).
0002 pour ne pas planter en front où pour être propre à l'usager je récupère l'exception InternalServerError qu n'était plus utilisée, pour afficher un message poli + l'id de l'erreur logguée (ce qui fait quelques petites modifications autour des erreurs pour retourner l'objet erreur pour avoir son id).
Entre les chunks de sql.py on ne le voit pas mais il y a un error = l'erreur identique précédemment logguée
.
Mis à jour par Lauréline Guérin il y a environ 2 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a environ 2 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 909f16eff391dc4f34d41b51448ff7bf13d1a6dc Author: Frédéric Péters <fpeters@entrouvert.com> Date: Mon Jan 31 16:06:47 2022 +0100 misc: display a technical error on form with removed fields (#61255) commit 04136fe6dce524ff6e98da87a34a41e5d56432a5 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Mon Jan 31 16:06:20 2022 +0100 backoffice: mark missing block fields in list of fields (#61255)
Mis à jour par Transition automatique il y a environ 2 ans
- Statut changé de Résolu (à déployer) à Solution déployée
backoffice: mark missing block fields in list of fields (#61255)