Skip to content

Commit 4183850

Browse files
Fix breaking change introduced by #3449 (#3589)
1 parent 41c3477 commit 4183850

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

inc/abstractitiltarget.class.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,4 +2539,20 @@ public function prepareInputForClone($input) {
25392539
$input['_skip_create_actors'] = true;
25402540
return $input;
25412541
}
2542+
2543+
protected static function getTemplateByName(string $name): int {
2544+
global $DB;
2545+
2546+
$targetTemplateType = (new static())->getTemplateItemtypeName();
2547+
$targetTemplate = new $targetTemplateType();
2548+
$targetTemplate->getFromDBByCrit([
2549+
'name' => $DB->escape($name),
2550+
]);
2551+
2552+
if ($targetTemplate->isNewItem()) {
2553+
return 0;
2554+
}
2555+
2556+
return $targetTemplate->getID();
2557+
}
25422558
}

inc/abstracttarget.class.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ abstract public static function getTargetItemtypeName(): string;
7979
*/
8080
abstract protected function getTaggableFields();
8181

82-
abstract protected function getTemplateItemtypeName();
83-
8482
const DESTINATION_ENTITY_CURRENT = 1;
8583
const DESTINATION_ENTITY_REQUESTER = 2;
8684
const DESTINATION_ENTITY_REQUESTER_DYN_FIRST = 3;
@@ -573,19 +571,4 @@ public function prepareInputForClone($input) {
573571
return $input;
574572
}
575573

576-
protected static function getTemplateByName(string $name): int {
577-
global $DB;
578-
579-
$targetTemplateType = (new static())->getTemplateItemtypeName();
580-
$targetTemplate = new $targetTemplateType();
581-
$targetTemplate->getFromDBByCrit([
582-
'name' => $DB->escape($name),
583-
]);
584-
585-
if ($targetTemplate->isNewItem()) {
586-
return 0;
587-
}
588-
589-
return $targetTemplate->getID();
590-
}
591574
}

0 commit comments

Comments
 (0)