Skip to content

Commit

Permalink
refactor preItem
Browse files Browse the repository at this point in the history
  • Loading branch information
MyvTsv committed Dec 19, 2024
1 parent 6fa3897 commit cce4fc0
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1681,24 +1681,13 @@ public static function preItem(CommonDBTM $item)
$subtype = $_REQUEST['_plugin_fields_subtype'];
}
foreach ($item->input as $key => $value) {
$container_find = false;
$container_id = self::findContainer(get_class($item), $type, $subtype);
if ($container_id === false) {
$container_is_find = $loc_c->getFromDB($container_id);
if (!$DB->fieldExists(static::getTable(), $key) || !$container_is_find) {
$container_id = self::findContainer(get_class($item));
if ($container_id === false) {
return false;
}
$container_find = true;
}
$loc_c->getFromDB($container_id);
if (!$DB->fieldExists(static::getTable(), $key)) {
if (!$container_find) {
$container_id = self::findContainer(get_class($item));
if ($container_id === false) {
return false;
}
$container_find = true;
}
}
if (!in_array($container_id, $c_id, true)) {
$c_id[] = $container_id;
Expand Down

0 comments on commit cce4fc0

Please sign in to comment.