Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

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


### Fixed

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