File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
186
186
];
187
187
foreach ($ problemFields as $ problemFields ) {
188
188
$ data [$ problemFields ] = $ this ->prepareTemplate (
189
- $ this ->fields [$ problemFields ],
189
+ $ this ->fields [$ problemFields ] ?? '' ,
190
190
$ formanswer ,
191
191
$ problemFields == 'content ' // only content supports rich text
192
192
);
Original file line number Diff line number Diff line change @@ -825,7 +825,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
825
825
$ data ['date ' ] = $ _SESSION ['glpi_currenttime ' ];
826
826
827
827
$ data ['content ' ] = $ this ->prepareTemplate (
828
- $ this ->fields ['content ' ],
828
+ $ this ->fields ['content ' ] ?? '' ,
829
829
$ formanswer ,
830
830
$ richText
831
831
);
Original file line number Diff line number Diff line change @@ -1392,7 +1392,14 @@ var plugin_formcreator = new function() {
1392
1392
window . location = data . redirect ;
1393
1393
}
1394
1394
} ) . fail ( function ( xhr , data ) {
1395
- if ( xhr . responseText == '' || typeof ( xhr . responseJSON . message ) == 'undefined' ) {
1395
+ if ( xhr . responseText == '' ) {
1396
+ displayAjaxMessageAfterRedirect ( ) ;
1397
+ return ;
1398
+ }
1399
+ if ( typeof ( xhr . responseJSON ) == 'undefined' ) {
1400
+ alert ( i18n . textdomain ( 'formcreator' ) . __ ( 'An internal error occurred. Please report it to administrator.' , 'formcreator' ) ) ;
1401
+ }
1402
+ if ( typeof ( xhr . responseJSON . message ) == 'undefined' ) {
1396
1403
displayAjaxMessageAfterRedirect ( ) ;
1397
1404
return ;
1398
1405
}
You can’t perform that action at this time.
0 commit comments