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 {
186186 ];
187187 foreach ($ problemFields as $ problemFields ) {
188188 $ data [$ problemFields ] = $ this ->prepareTemplate (
189- $ this ->fields [$ problemFields ],
189+ $ this ->fields [$ problemFields ] ?? '' ,
190190 $ formanswer ,
191191 $ problemFields == 'content ' // only content supports rich text
192192 );
Original file line number Diff line number Diff line change @@ -825,7 +825,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
825825 $ data ['date ' ] = $ _SESSION ['glpi_currenttime ' ];
826826
827827 $ data ['content ' ] = $ this ->prepareTemplate (
828- $ this ->fields ['content ' ],
828+ $ this ->fields ['content ' ] ?? '' ,
829829 $ formanswer ,
830830 $ richText
831831 );
Original file line number Diff line number Diff line change @@ -1392,7 +1392,14 @@ var plugin_formcreator = new function() {
13921392 window . location = data . redirect ;
13931393 }
13941394 } ) . 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' ) {
13961403 displayAjaxMessageAfterRedirect ( ) ;
13971404 return ;
13981405 }
You can’t perform that action at this time.
0 commit comments