Skip to content

Fix broken links marked as valid when ancestor is not public - #4473

Open
jarlhengstmengel wants to merge 1 commit into
developfrom
bug/broken-links-are-reported-as-valid-when-target-page-not-public
Open

Fix broken links marked as valid when ancestor is not public#4473
jarlhengstmengel wants to merge 1 commit into
developfrom
bug/broken-links-are-reported-as-valid-when-target-page-not-public

Conversation

@jarlhengstmengel

Copy link
Copy Markdown
Contributor

Short description

Fixes that broken links are marked as valid when a ancestor is not public

Proposed changes

  • Check if ancestors of the linked page have public translations

Side effects

  • None

Faithfulness to issue description and design

There are no intended deviations from the issue and design.

How to test

  1. Create page A with status Draft.
  2. Create child page B under page A with status Public.
  3. Create page C and add a link to page B in its content.
  4. Check Broken Links menu.

Also check if linked events and locations work as expected

Resolved issues

Fixes: #4325


Pull Request Review Guidelines

@MizukiTemma

Copy link
Copy Markdown
Member

@jarlhengstmengel
Thank you for the PR 😸
Links to a child page with draft parent is now judged as invalid, and I like it that you added a new status explanation "One of the page ancestors is not public" ✅

There are some cases I would like this PR to cover but if you think it's out of the scope, just open a new issue ✏️

  1. In the current system (before this PR) links to pages like Page B (from the example in "How to test") are listed as valid. They seem not to move automatically to the "invalid" column. Can we probably run a command or add it as migration? I would expect they are moved to "invalid" after this PR is deployed 👀

  2. After publishing the page A, links to page B should move to "valid" column in my opinion. They move to "valid" only after Page C is updated. I think it is more intuitve for users if the links move automatically between "valid" and "invalid" whenever the status of their parent(s) changes 💡

@seluianova
seluianova self-requested a review August 3, 2026 13:17
@jarlhengstmengel

Copy link
Copy Markdown
Contributor Author

In the current system (before this PR) links to pages like Page B (from the example in "How to test") are listed as valid. They seem not to move automatically to the "invalid" column. Can we probably run a command or add it as migration? I would expect they are moved to "invalid" after this PR is deployed 👀

I think we have the "checklinks" command that checks all links. Bit afraid to use it though 😅

After publishing the page A, links to page B should move to "valid" column in my opinion. They move to "valid" only after Page C is updated. I think it is more intuitve for users if the links move automatically between "valid" and "invalid" whenever the status of their parent(s) changes 💡

So expand the linkcheck listener to cover linked children?

@MizukiTemma

Copy link
Copy Markdown
Member

In the current system (before this PR) links to pages like Page B (from the example in "How to test") are listed as valid. They seem not to move automatically to the "invalid" column. Can we probably run a command or add it as migration? I would expect they are moved to "invalid" after this PR is deployed 👀

I think we have the "checklinks" command that checks all links. Bit afraid to use it though 😅

🤔 We have one chance to see whether it goes well: deployment to the test system. I prefer to call the command in a migration but we can also run it manually after release (cons: we may forget it)

After publishing the page A, links to page B should move to "valid" column in my opinion. They move to "valid" only after Page C is updated. I think it is more intuitve for users if the links move automatically between "valid" and "invalid" whenever the status of their parent(s) changes 💡

So expand the linkcheck listener to cover linked children?

It would be ideal, but we can handle it as separate issue too. I'll leave the deicision on you as PR author.

@MizukiTemma MizukiTemma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the fix 😸

I opened an issue for my suggestion to tackle it separately as discussed today #4486

We can fix the existing links by command.

@seluianova seluianova left a comment

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.

It seems the fix works for a two-level hierarchy (one parent and one child), but it doesn't work for deeper nesting.

I tested the following structure:
image

When I link the "Level 3" page somewhere, the link checker still reports it as a valid link.
image

Do we want to treat this as a separate issue or fix here?

@connium

connium commented Aug 11, 2026

Copy link
Copy Markdown

Do we want to treat this as a separate issue or fix here?

Just discussed in the meeting: this will be fixed in this issue (= no separate issue).

@jarlhengstmengel

Copy link
Copy Markdown
Contributor Author

@seluianova I'm afraid I can't reproduce the situation you describe 😅 I created couple of nested pages down to 4th level. Only the root is in Draft and the others published. When linking the page at 4th level in another page, it gets reported correctly as invalid

image image

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.

Broken links are reported as valid when the target page has a draft parent

4 participants