In suitecrm 7.11.5 I run into problem with pdf templates.
When I choose module type in create template, in insert field module fields are not showing.
Insert module name changes fine but individual fields do not work.
In console it prints an error
Uncaught ReferenceError: regularOptions is not defined
It’s printed by a function: populateVariables which after taking a look in the code is indeed there to populate insert fields. I could not find where populateVariables should be defined.
In addition in order to write this post and use correct terminology I changed my CRM language to English instead of Polish. Strangely enough this issue is non existent in English version fields show up fine, even for custom module I just added.
Can anyone help me shed some light on this issue?
edit forgot to add: populateVariables can be found at modules/AOS_PDF_Templates/AOS_PDF_Templates.js
for which module are you generating the PDF template? check out if that has your language file something like modules/Accounts/language/pl_pl.lang.php and for your custom Dropdown options you can add language in the module custom folder path.
Thanks for quick reply
I wanted to create template for accounts and a custom module I created. But above mentioned issue is true for all modules in pdf template creator.
Language files exist for all the modules mentioned in pdf templates.
I’m unsure what you meant with Dropdown and how it can help fix my problem with fields not showing. If you could elaborate here.
Below are 2 pictures one in polish and other in English to show the difference in modules, Account label in polish is renamed to Darczyńcy. Also the insert variable list is open in first picture you can barely see it because it’s empty.
For a quick solution, you can create the PDF template using english language and insert the variables. i would need to install polish language pack and check if its a hard coded module name look up to make the variables list in PDF templates.
In the end my co-workers are going to work with pdf templates so I would be thankful if you could check out the polish language pack. On a side note I’ve seen it work in the past on a different instance with polish language.
As I wrote in the 1 post there is a JS error in console:
Uncaught ReferenceError: regularOptions is not defined caused by function populateVariables in modules/AOS_PDF_Templates/AOS_PDF_Templates.js
The error only appears in console in Polish version, in English it’s doesn’t appear and functionality works fine.
Okay, I managed to fix the issue on accident while fixing my past co-worker mistake. He had job to create a similar module to one and in his disregard he created a faulty module with with some issues one of them being labels. His custom module was added to PDF templates and one label while creating array for pdf templates it passed an empty value without quotes which was breaking array creation.
Also as @pgr said, like a rookie I was reading wrong error in console. The actual message was 2 lines above.
After finding the cause I fixed it by accident by redeploying my colleague module with my fixes.