Extension - Templates in docx format - corrupted file when & is saved in field type entity
Posted: 21 Feb 2022, 20:06
This is more less the same bug that was already reported in the past (viewtopic.php?f=20&t=3242&p=13048), however, now it affects only field type entity.
Where: ext/templates/export_templates - docx template (https://docs.rukovoditel.net/index.php?p=100)
What: In case there is a character & in name of record linked via field type entity and field type entity is used as information block in docx template, the exported docx is corrupted.
How replicate:
1. Create an entity Projects and Companies.
2. Add field Asignee (type entity) to Projects and chose Select Entity: Companies.
3. Create a docx template for entity Projects and insert block for field Asignee in the docx template (e.g. Asignee: ${78}).
4. Create a new record in entity Companies with field name "A&B" or any other name with &.
5. Create a new record in Projects and select Asignee: "A&B".
5. Try exporting newly saved record in Projects to docx template. The file is corrupted.
6. Delete character & from name of the record in Companies and try exporting Projects again. Now the file is ok.
Where: ext/templates/export_templates - docx template (https://docs.rukovoditel.net/index.php?p=100)
What: In case there is a character & in name of record linked via field type entity and field type entity is used as information block in docx template, the exported docx is corrupted.
How replicate:
1. Create an entity Projects and Companies.
2. Add field Asignee (type entity) to Projects and chose Select Entity: Companies.
3. Create a docx template for entity Projects and insert block for field Asignee in the docx template (e.g. Asignee: ${78}).
4. Create a new record in entity Companies with field name "A&B" or any other name with &.
5. Create a new record in Projects and select Asignee: "A&B".
5. Try exporting newly saved record in Projects to docx template. The file is corrupted.
6. Delete character & from name of the record in Companies and try exporting Projects again. Now the file is ok.