Skip to content

Commit

Permalink
fix(targetproblem,targetchange,targetticket): ensure passing string
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Feb 5, 2024
1 parent 9623f41 commit 4604e62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inc/targetchange.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public static function import(PluginFormcreatorLinker $linker, array $input = []
// Find template by name
$input['changetemplates_id'] = 0;
if ($input['_changetemplate'] !== '') {
$targetTemplate = self::getTemplateByName($input['_changetemplate']);
$targetTemplate = self::getTemplateByName($input['_changetemplate'] ?? '');
if ($targetTemplate->isNewItem()) {
$typeName = strtolower(self::getTypeName());
throw new ImportFailureException(sprintf(__('Failed to add or update the %1$s %2$s: It uses a non existent template ', 'formceator'), $typeName, $input['name']));
Expand Down
2 changes: 1 addition & 1 deletion inc/targetproblem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public static function import(PluginFormcreatorLinker $linker, array $input = []
// Find template by name
$input['problemtemplates_id'] = 0;
if ($input['_problemtemplate'] !== '') {
$targetTemplate = self::getTemplateByName($input['_problemtemplate']);
$targetTemplate = self::getTemplateByName($input['_problemtemplate'] ?? '');
if ($targetTemplate->isNewItem()) {
$typeName = strtolower(self::getTypeName());
throw new ImportFailureException(sprintf(__('Failed to add or update the %1$s %2$s: It uses a non existent template ', 'formceator'), $typeName, $input['name']));
Expand Down
2 changes: 1 addition & 1 deletion inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ public static function import(PluginFormcreatorLinker $linker, array $input = []
// Find template by name
$input['tickettemplates_id'] = 0;
if ($input['_tickettemplate'] !== '') {
$targetTemplate = self::getTemplateByName($input['_tickettemplate']);
$targetTemplate = self::getTemplateByName($input['_tickettemplate'] ?? '');
if ($targetTemplate->isNewItem()) {
$typeName = strtolower(self::getTypeName());
throw new ImportFailureException(sprintf(__('Failed to add or update the %1$s %2$s: It uses a non existent template ', 'formceator'), $typeName, $input['name']));
Expand Down

0 comments on commit 4604e62

Please sign in to comment.