Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch Preview Link for bug where references to other entities being previewed don't display #785

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

stephen-cox
Copy link
Member

What does this change?

Patched Preview Link for issue #771, drupal.org issue: https://www.drupal.org/project/preview_link/issues/3481523

The patch changes the node access hook so Preview Links access handler is run for all pages included in a preview link entity. Without the hook it only runs for the page being viewed.

How to test

See #771 (comment) on how to reproduce the issue this should fix.

How can we measure success?

Previewing more than one page becomes easier and works as people expect.

Have we considered potential risks?

This changes an access handler so has the potential to allow more than it should.

@stephen-cox
Copy link
Member Author

Tests failures are fixed with #787

@stephen-cox stephen-cox requested review from ekes and finnlewis October 18, 2024 13:12
@ekes
Copy link
Member

ekes commented Oct 22, 2024

To clarify if I understand what your patch is doing:
Previously the access check override looked at the route, checked if it is in preview mode, checked if the route entity is one that can be previewed.
Now the access check, looks if it's in preview mode, runs through all entities that can be previewed, and sees if there's a match?

@ekes ekes closed this Oct 22, 2024
@ekes ekes reopened this Oct 22, 2024
@ekes
Copy link
Member

ekes commented Oct 22, 2024

Hit wrong button, was just the question :-)

@stephen-cox
Copy link
Member Author

Previously the access check override looked at the route, checked if it is in preview mode, checked if the route entity is one that can be previewed.
Now the access check, looks if it's in preview mode, runs through all entities that can be previewed, and sees if there's a match?

That's right - previously is only checked access for the entity being previewed but now checks whether the entity is included in a related preview link.

@finnlewis
Copy link
Member

@ekes is happy with this, let's merge it!

@finnlewis finnlewis merged commit 6767ffd into 3.x Oct 22, 2024
10 of 16 checks passed
@finnlewis finnlewis deleted the fix/3.x/771-preview-links-not-showing branch October 22, 2024 11:54
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.

3 participants