Skip to content

Commit

Permalink
fix type restriction, when importing setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Aug 17, 2023
1 parent 22bdedf commit d2d4bc6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Model/Config/PluginConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ public static function importFromXML(string $xml_file_path)
$xoctPublicationUsage->setMdType($node->getElementsByTagName('md_type')->item(0)->nodeValue);
$xoctPublicationUsage->setDisplayName($node->getElementsByTagName('display_name')->item(0)->nodeValue);
$xoctPublicationUsage->setGroupId($node->getElementsByTagName('group_id')->item(0)->nodeValue);
$xoctPublicationUsage->setMediaType($node->getElementsByTagName('mediatype')->item(0)->nodeValue);
$xoctPublicationUsage->setIgnoreObjectSettings($node->getElementsByTagName('ignore_object_setting')->item(0)->nodeValue);
$mediatype = $node->getElementsByTagName('mediatype')->item(0)->nodeValue;
$xoctPublicationUsage->setMediaType($mediatype ?? '');
$ignore_object_setting = (bool) $node->getElementsByTagName('ignore_object_setting')->item(0)->nodeValue;
$xoctPublicationUsage->setIgnoreObjectSettings($ignore_object_setting);

if (!PublicationUsage::where(['usage_id' => $xoctPublicationUsage->getUsageId()])->hasSets()) {
$xoctPublicationUsage->create();
Expand Down Expand Up @@ -270,8 +272,10 @@ public static function importFromXML(string $xml_file_path)
$xoctPublicationSubUsage->setMdType($node->getElementsByTagName('md_type')->item(0)->nodeValue);
$xoctPublicationSubUsage->setDisplayName($node->getElementsByTagName('display_name')->item(0)->nodeValue);
$xoctPublicationSubUsage->setGroupId($node->getElementsByTagName('group_id')->item(0)->nodeValue);
$xoctPublicationSubUsage->setMediaType($node->getElementsByTagName('mediatype')->item(0)->nodeValue);
$xoctPublicationSubUsage->setIgnoreObjectSettings($node->getElementsByTagName('ignore_object_setting')->item(0)->nodeValue);
$mediatype = $node->getElementsByTagName('mediatype')->item(0)->nodeValue;
$xoctPublicationSubUsage->setMediaType($mediatype ?? '');
$ignore_object_setting = (bool) $node->getElementsByTagName('ignore_object_setting')->item(0)->nodeValue;
$xoctPublicationSubUsage->setIgnoreObjectSettings($ignore_object_setting);
$xoctPublicationSubUsage->create();
}

Expand Down

0 comments on commit d2d4bc6

Please sign in to comment.