Open ojs87 opened 8 months ago
Hey @ojs87 !
Apologies if I'm wrong, but this looks like it might be a duplicate of: https://github.com/salesagility/SuiteCRM/issues/10307
Which is resolved by: https://github.com/salesagility/SuiteCRM/pull/10308 (Which was pulled into the latest release)
Is that right?
If not, I'm happy to investigate this ticket further Thanks!
hey @johnM2401,
This looks like the same issue with using the beanList on an extended module but #10308 deals with building the smarty templates and this fix deals with parsing email templates so I don't think #10308 fixes this issue. Maybe the team would prefer to fix my issue in a similar way though.
Good catch though I didn't see that other PR when searching for dupes.
Cheers!
Issue
Modules that are extended in the custom folder, e.g. AOS_Quotes.php, are not correctly replacing variables based on the variables available in the Email Templates module. This is due to an extended module using a different beanList name(e.g. customAOS_Quotes) and the template parser using that beanList name as the key for the variables.
Expected Behavior
Extended modules should still be able to use the basic variable options in the email template editor
Actual Behavior
The basic variables aren't parsed.
Possible Fix
use the $bean->table_name as a key for template_parser, rather than the name of the module in the $beanList global array.
Steps to Reproduce
class CustomAOS_Quotes extends AOS_Quotes_sugar { public function save($check_notify = false) {
}
<?php $objectList['AOS_Quotes'] = 'AOS_Quotes'; $beanList['AOS_Quotes'] = 'CustomAOS_Quotes'; $beanFiles['CustomAOS_Quotes'] = 'custom/modules/AOS_Quotes/CustomAOS_Quotes.php';