Skip to content

Add isPermaLink=false support to setPublicId() - #103

Merged
Grotax merged 2 commits into
mainfrom
copilot/feature-enhance-item-set-public-id
Sep 20, 2026
Merged

Grotax merged 2 commits into
mainfrom
copilot/feature-enhance-item-set-public-id

Conversation

Copilot AI commented Jul 19, 2026 •

Copy link
Copy Markdown

RSS <guid isPermaLink="false"> allows non-URL identifiers, but the library had no way to set or preserve this attribute — guids were always emitted without it, forcing values to be valid URLs.

Changes

  • NodeInterface / Node: Added bool $isPermaLink = true parameter to setPublicId() and a getPublicIdIsPermaLink(): bool getter. The flag is stored as $publicIdIsPermaLink (defaults true, fully backwards-compatible).
  • Rule/PublicId::setProperty(): Reads isPermaLink attribute from parsed DOM element ('false' → false, anything else → true) and forwards it to setPublicId(). Simplified the link-auto-set condition to use the resolved flag.
  • Rule/PublicId::addElement(): Emits isPermaLink="false" on the <guid> element when the flag is false; omits the attribute otherwise (RSS default is true).

Usage

// Non-URL identifier, will render as <guid isPermaLink="false">urn:uuid:...</guid>
$item->setPublicId('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', false);

// Default behaviour unchanged — permalink assumed
$item->setPublicId('https://example.com/post/1');

Copilot AI linked an issue Jul 19, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Enhance item->setPublicId() for guid with isPermaLink=false Add isPermaLink=false support to setPublicId() Jul 19, 2026
Copilot AI requested a review from Grotax July 19, 2026 09:40
@Grotax
Grotax marked this pull request as ready for review September 20, 2026 07:07
@Grotax
Grotax force-pushed the copilot/feature-enhance-item-set-public-id branch from 6e9cd91 to 2be53ff Compare September 20, 2026 07:10
@Grotax
Grotax merged commit ec8ba4e into main Sep 20, 2026
8 checks passed
@Grotax
Grotax deleted the copilot/feature-enhance-item-set-public-id branch September 20, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] enhance item->setPublicId() for guid with isPermaLink=false

2 participants