Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Changed

- Add logic to set the node's link from the <guid> element when isPermaLink="true" and no link is present. (#8)


### Fixed
Expand Down
5 changes: 5 additions & 0 deletions src/FeedIo/Rule/PublicId.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class PublicId extends RuleAbstract
public function setProperty(NodeInterface $node, \DOMElement $element): void
{
$node->setPublicId($element->nodeValue);
if ($element->nodeName == 'guid'
&& $element->getAttribute('isPermaLink') === 'true'
&& is_null($node->getLink())) {
$node->setLink($element->nodeValue);
}
}

/**
Expand Down