FIX: Fix mandatory field validation for select (empty '-1') and textarea (CKEDITOR not defined) (#39458)

Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>
This commit is contained in:
Zakaria Boushaba 2026-08-11 18:46:22 +01:00 committed by GitHub
parent 6a647097bd
commit d0810e11e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12055,7 +12055,7 @@ function printCommonFooter($zone = 'private')
if (tmptypefield == 'textarea') {
// We must instead check the content of ckeditor
var tmpeditor = CKEDITOR.instances['".dol_escape_js($paramkey)."'];
var tmpeditor = (typeof CKEDITOR !== 'undefined') ? CKEDITOR.instances['".dol_escape_js($paramkey)."'] : null;
if (tmpeditor) {
tmpvalue = tmpeditor.getData();
console.log('For textarea tmpvalue is '+tmpvalue);
@ -12063,7 +12063,7 @@ function printCommonFooter($zone = 'private')
}
let tmpvalueisempty = false;
if (tmpvalue === null || tmpvalue === undefined || tmpvalue === '' || tmpvalue === -1) {
if (tmpvalue === null || tmpvalue === undefined || tmpvalue === '' || tmpvalue === -1 || tmpvalue === '-1') {
tmpvalueisempty = true;
}
if (tmpvalue === '0' && (tmptypefield == 'select' || tmptypefield == 'input')) {