Bug #52694
génération du form_details dans un odt : le contenu de définition de style n'est plus remplacé
0%
Description
Vraisemblalement par une mise à jour python / ElementTree, qui a emmené le retrait de getchilren, la forme alternative ne fonctionne pas :
- for child in node.getchildren(): + for child in node: node.remove(child)
(bout de 7b09c482222e087b2687bb34adf2366392a8ce98 qui n'a pas de référence redmine)
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 3 ans
- Fichier 0001-workflows-fix-removal-of-existing-form_details-odt-s.patch 0001-workflows-fix-removal-of-existing-form_details-odt-s.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Il y a une note à ce sujet dans la documentation :
Note that concurrent modification while iterating can lead to problems, just like when iterating and modifying Python lists or dicts. Therefore, the example first collects all matching elements with root.findall(), and only then iterates over the list of matches.
— https://docs.python.org/3/library/xml.etree.elementtree.html
"can lead to problems" c'était genre un élément sur deux retiré, et le test qui existait pour bien vérifier que la section était vidée, il s'assurait juste que le premier ait bien disparu, pas de chance.
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Ok. Mais pourquoi pas list(node)
?
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 17b135023dde82bbcfec02ff8f77258a1171ba80 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Sat Apr 3 17:48:47 2021 +0200 workflows: fix removal of existing form_details odt section (#52694)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
workflows: fix removal of existing form_details odt section (#52694)