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.
Extension - Templates in docx format - corrupted file when & is saved in field type entity
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: Extension - Templates in docx format - corrupted file when & is saved in field type entity
I think I have found issue. File from archive replace to plugins\ext\classes\templates\
Let me know if it works ok now.
Let me know if it works ok now.
- Attachments
-
- export_templates_blocks_fix1.zip
- (10.89 KiB) Downloaded 132 times
Re: Extension - Templates in docx format - corrupted file when & is saved in field type entity
it did not work for me, the word document cannot be opened. Do I change it back to & you can open the worddocment. it's about A&B for me I have to write A&B
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: Extension - Templates in docx format - corrupted file when & is saved in field type entity
Patrick, you have applied this patch?
If so then please reproduce issue on personal demo https://www.rukovoditel.net/account_dem ... quest=demo
and give me the link to the demo. I will look where issue is.
If so then please reproduce issue on personal demo https://www.rukovoditel.net/account_dem ... quest=demo
and give me the link to the demo. I will look where issue is.
Re: Extension - Templates in docx format - corrupted file when & is saved in field type entity
The patch above solved the problem in our use case. Thanks, Sergey!
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: Extension - Templates in docx format - corrupted file when & is saved in field type entity
Patrick, I have found your issue. File from attached archive replace to plugins\ext\classes\templates\
Let me know if it's fixed.
Let me know if it's fixed.
- Attachments
-
- export_templates_blocks_fix2.zip
- (10.9 KiB) Downloaded 144 times
Re: Extension - Templates in docx format - corrupted file when & is saved in field type entity
it works!! Sergey you are a genius! Thank you very much