When extending the OOTB Surveys module, the field validation on editview has stopped working for most or all fields. When checking the cached EditView template, none of the validation js has been added. This means that, for example, the mandatory 'name' field can be left blank, and the record saved.
Expected Behavior
The buildTemplate function of TemplateHandler should be able to correctly find the module name when building the cached editview tpl file, allowing the javascript object to be set up with the correct bean. This allows for all mandatory fields to be correctly validated on save.
Actual Behavior
The module name isn't correct (using the name of the extended bean, and not its core counterpart), so when javascript's addAllFields runs, it misses most or all of the fields to be validated. This results in missing javascript, preventing field validation on editview save.
Possible Fix
Use BeanFactory to get the module name, instead of looking it up in the BeanList global variable
Steps to Reproduce
Extend the Surveys Bean through the code (e.g. in custom/Extension/application/Ext/Include directory)
Issue
When extending the OOTB Surveys module, the field validation on editview has stopped working for most or all fields. When checking the cached EditView template, none of the validation js has been added. This means that, for example, the mandatory 'name' field can be left blank, and the record saved.
Expected Behavior
The
buildTemplate
function ofTemplateHandler
should be able to correctly find the module name when building the cached editview tpl file, allowing the javascript object to be set up with the correct bean. This allows for all mandatory fields to be correctly validated on save.Actual Behavior
The module name isn't correct (using the name of the extended bean, and not its core counterpart), so when javascript's
addAllFields
runs, it misses most or all of the fields to be validated. This results in missing javascript, preventing field validation on editview save.Possible Fix
Use BeanFactory to get the module name, instead of looking it up in the
BeanList
global variableSteps to Reproduce
custom/Extension/application/Ext/Include
directory)cache/themes/SuiteP/modules/Surveys/EditView.tpl
Context
Prevents correct validation of a module which can be used to design customer-facing surveys, medium priority
Your Environment