Skip to content

Use space key instead of space id for broken links because space id m…#200

Merged
danielriedmueller merged 4 commits intomainfrom
SpaceKeyForBrokenLinks
Mar 31, 2026
Merged

Use space key instead of space id for broken links because space id m…#200
danielriedmueller merged 4 commits intomainfrom
SpaceKeyForBrokenLinks

Conversation

@DvogelHallowelt
Copy link
Copy Markdown
Contributor

…ay only be -1

Comment thread src/Converter/Processor/PageLink.php Outdated
private function ensureSpaceId( DOMNode $node ): int {
$spaceId = $this->currentSpaceId;
$spaceKey = $node->getAttribute( 'ri:space-key' );
$this->spaceKey = '';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->spaceKey shouldnt be set here. its immediately overwritten and this should be a pure function which doesnt just change this global variable. here its set to empty string and if there is no ri:space-key attribute, in generateConfluenceKey on line 98 its used and leads to wrong key

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same is in ImagePageLinkHelper

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@danielriedmueller danielriedmueller merged commit 9c1f27a into main Mar 31, 2026
1 check passed
@danielriedmueller danielriedmueller deleted the SpaceKeyForBrokenLinks branch March 31, 2026 05:18
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.

2 participants