Skip to content

Commit f5de8bb

Browse files
committed
fix(targetticket): prevent setting a type from an incompatible question
1 parent b172ba8 commit f5de8bb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

inc/targetticket.class.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,13 @@ protected function setTargetType(array $data, PluginFormcreatorFormAnswer $forma
10901090
])->current();
10911091
if (isset($type['answer']) && ctype_digit($type['answer'])) {
10921092
$type = $type['answer'];
1093+
} else {
1094+
// Invalid value. Maybe the questin is not compatible.
1095+
trigger_error(sprintf("Attempt to set the type of a ticket from an incompatible question. Check the target ticket %s of the form ID=%s",
1096+
$this->fields['name'],
1097+
$this->getForm()->getID()
1098+
));
1099+
$type = null;
10931100
}
10941101
break;
10951102
case self::REQUESTTYPE_SPECIFIC:

0 commit comments

Comments
 (0)