Skip to content

Commit

Permalink
Handle finding non-injectable option
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 authored and cedric-anne committed Mar 24, 2022
1 parent 31f48de commit c0311dd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions inc/commoninjectionlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,9 @@ private function manageFieldValues() {
$searchOption = self::findSearchOption($searchOptions, $field);
//searchoption relation type is already manage by manageRelations()
//skip it
if ((isset($searchOption['displaytype']) && $searchOption['displaytype'] != 'relation')
|| !isset($searchOption['displaytype'])) {
if ($searchOption !== false &&
((isset($searchOption['displaytype']) && $searchOption['displaytype'] != 'relation')
|| !isset($searchOption['displaytype']))) {
$this->getFieldValue($injectionClass, $itemtype, $searchOption, $field, $value);
}
}
Expand Down Expand Up @@ -1512,7 +1513,7 @@ private function effectiveAddOrUpdate($injectionClass, $item, $values, $add = tr

foreach ($values as $key => $value) {
$option = self::findSearchOption($options, $key);
if (!isset($option['checktype']) || $option['checktype'] != self::FIELD_VIRTUAL) {
if ($option !== false && (!isset($option['checktype']) || $option['checktype'] != self::FIELD_VIRTUAL)) {
//If field is a dropdown and value is '', then replace it by 0
if (self::isFieldADropdown($option['displaytype']) && $value == self::EMPTY_VALUE) {
$toinject[$key] = self::DROPDOWN_EMPTY_VALUE;
Expand Down

0 comments on commit c0311dd

Please sign in to comment.