Skip to content

Commit

Permalink
fix: various fixes on duplicate / import
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
btry committed Jun 5, 2020

Unverified

No user is associated with the committer email.
1 parent ba70895 commit 0d7c4dd
Showing 6 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion inc/item_targetticket.class.php
Original file line number Diff line number Diff line change
@@ -182,7 +182,6 @@ protected function convertUuids(&$parameter) {
public function deleteObsoleteItems(CommonDBTM $container, array $exclude)
{
$keepCriteria = [
self::$itemtype_2 => $container->getType(),
self::$items_id_2 => $container->getID(),
];
if (count($exclude) > 0) {
4 changes: 2 additions & 2 deletions inc/question.class.php
Original file line number Diff line number Diff line change
@@ -587,15 +587,15 @@ public function pre_deleteItem() {
public function post_addItem() {
if (!isset($this->input['_skip_checks']) || !$this->input['_skip_checks']) {
$this->updateConditions($this->input);
$this->updateParameters($this->input);
}
$this->updateParameters($this->input);
}

public function post_updateItem($history = 1) {
if (!isset($this->input['_skip_checks']) || !$this->input['_skip_checks']) {
$this->updateConditions($this->input);
$this->updateParameters($this->input);
}
$this->updateParameters($this->input);
}

/**
2 changes: 1 addition & 1 deletion inc/questionparameter.class.php
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ public function prepareInputforAdd($input) {
public function deleteObsoleteItems(CommonDBTM $container, array $exclude)
{
$keepCriteria = [
self::$items_id => $container->getID(),
static::$items_id => $container->getID(),
];
if (count($exclude) > 0) {
$keepCriteria[] = ['NOT' => ['id' => $exclude]];
2 changes: 1 addition & 1 deletion inc/target_actor.class.php
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@ public function export($remove_uuid = false) {
public function deleteObsoleteItems(CommonDBTM $container, array $exclude)
{
$keepCriteria = [
self::$items_id => $container->getID(),
static::$items_id => $container->getID(),
];
if (count($exclude) > 0) {
$keepCriteria[] = ['NOT' => ['id' => $exclude]];
1 change: 0 additions & 1 deletion inc/targetchange.class.php
Original file line number Diff line number Diff line change
@@ -651,7 +651,6 @@ public function getTargetChangesForForm($formId) {
'WHERE' => [
'plugin_formcreator_forms_id' => $formId
],
'ORDER' => 'order ASC'
]);
foreach ($rows as $row) {
$target = new self();
1 change: 0 additions & 1 deletion inc/targetticket.class.php
Original file line number Diff line number Diff line change
@@ -1225,7 +1225,6 @@ public function getTargetTicketsForForm($formId) {
'WHERE' => [
'plugin_formcreator_forms_id' => $formId
],
'ORDER' => 'order ASC'
]);
foreach ($rows as $row) {
$target = new self();

0 comments on commit 0d7c4dd

Please sign in to comment.