@@ -383,49 +383,55 @@ public function prepareInputForUpdate($input) {
383383 || !$ input ['_skip_checks ' ]) {
384384
385385 $ input ['content ' ] = Html::entity_decode_deep ($ input ['content ' ]);
386-
387- switch ($ input ['destination_entity ' ]) {
388- case self ::DESTINATION_ENTITY_SPECIFIC :
389- $ input ['destination_entity_value ' ] = $ input ['_destination_entity_value_specific ' ];
390- unset($ input ['_destination_entity_value_specific ' ]);
391- break ;
392- case self ::DESTINATION_ENTITY_USER :
393- $ input ['destination_entity_value ' ] = $ input ['_destination_entity_value_user ' ];
394- unset($ input ['_destination_entity_value_user ' ]);
395- break ;
396- case self ::DESTINATION_ENTITY_ENTITY :
397- $ input ['destination_entity_value ' ] = $ input ['_destination_entity_value_entity ' ];
398- unset($ input ['_destination_entity_value_entity ' ]);
399- break ;
400- default :
401- $ input ['destination_entity_value ' ] = 'NULL ' ;
402- break ;
386+
387+ if (isset ($ input ['destination_entity ' ])) {
388+ switch ($ input ['destination_entity ' ]) {
389+ case self ::DESTINATION_ENTITY_SPECIFIC :
390+ $ input ['destination_entity_value ' ] = $ input ['_destination_entity_value_specific ' ];
391+ unset($ input ['_destination_entity_value_specific ' ]);
392+ break ;
393+ case self ::DESTINATION_ENTITY_USER :
394+ $ input ['destination_entity_value ' ] = $ input ['_destination_entity_value_user ' ];
395+ unset($ input ['_destination_entity_value_user ' ]);
396+ break ;
397+ case self ::DESTINATION_ENTITY_ENTITY :
398+ $ input ['destination_entity_value ' ] = $ input ['_destination_entity_value_entity ' ];
399+ unset($ input ['_destination_entity_value_entity ' ]);
400+ break ;
401+ default :
402+ $ input ['destination_entity_value ' ] = 'NULL ' ;
403+ break ;
404+ }
403405 }
404406
405- switch ($ input ['urgency_rule ' ]) {
406- case self ::URGENCY_RULE_ANSWER :
407- $ input ['urgency_question ' ] = $ input ['_urgency_question ' ];
408- unset($ input ['_urgency_question ' ]);
409- break ;
410- case self ::URGENCY_RULE_SPECIFIC :
411- $ input ['urgency_question ' ] = $ input ['_urgency_specific ' ];
412- unset($ input ['_urgency_specific ' ]);
413- break ;
414- default :
415- $ input ['urgency_question ' ] = '0 ' ;
407+ if (isset ($ input ['urgency_rule ' ])) {
408+ switch ($ input ['urgency_rule ' ]) {
409+ case self ::URGENCY_RULE_ANSWER :
410+ $ input ['urgency_question ' ] = $ input ['_urgency_question ' ];
411+ unset($ input ['_urgency_question ' ]);
412+ break ;
413+ case self ::URGENCY_RULE_SPECIFIC :
414+ $ input ['urgency_question ' ] = $ input ['_urgency_specific ' ];
415+ unset($ input ['_urgency_specific ' ]);
416+ break ;
417+ default :
418+ $ input ['urgency_question ' ] = '0 ' ;
419+ }
416420 }
417421
418- switch ($ input ['category_rule ' ]) {
419- case self ::CATEGORY_RULE_ANSWER :
420- $ input ['category_question ' ] = $ input ['_category_question ' ];
421- unset($ input ['_category_question ' ]);
422- break ;
423- case self ::CATEGORY_RULE_SPECIFIC :
424- $ input ['category_question ' ] = $ input ['_category_specific ' ];
425- unset($ input ['_category_specific ' ]);
426- break ;
427- default :
428- $ input ['category_question ' ] = '0 ' ;
422+ if (isset ($ input ['category_rule ' ])) {
423+ switch ($ input ['category_rule ' ]) {
424+ case self ::CATEGORY_RULE_ANSWER :
425+ $ input ['category_question ' ] = $ input ['_category_question ' ];
426+ unset($ input ['_category_question ' ]);
427+ break ;
428+ case self ::CATEGORY_RULE_SPECIFIC :
429+ $ input ['category_question ' ] = $ input ['_category_specific ' ];
430+ unset($ input ['_category_specific ' ]);
431+ break ;
432+ default :
433+ $ input ['category_question ' ] = '0 ' ;
434+ }
429435 }
430436
431437 $ plugin = new Plugin ();
0 commit comments