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

Editor can't set unpublished Service Landing Page as parent of Service Page #216

Open
keelanfh opened this issue Jun 30, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@keelanfh
Copy link
Member

Steps to replicate

  • Fresh LGD install with localgov_demo
  • Log in as an Editor
  • Create a Service Landing Page and save it without publishing
  • Create a Service Page
  • Attempt to set the Service Landing Page as the Parent of the Service Page

Expected behaviour

  • The unpublished Service Landing Page appears as an option in the autocomplete and can be set as the Parent

Observed behaviour

  • The unpublished Service Landing Page does not appear in the autocomplete

Note: this works as expected when logged in as an Admin. It is only when logged in as Editor that I can see this issue.

@willguv
Copy link
Member

willguv commented May 22, 2024

@andybroomfield does your patch fix this issue? Thanks

@willguv willguv moved this from Discuss to Refine in 2024 Mission: Editor experience May 22, 2024
@andybroomfield
Copy link
Contributor

Don't know if its the patch or not, as it's an unrelated issue. We never encouterd it at BHCC as we had bypass node access enabled for editors for a while, and we disabled it but replaced it with view_unpublished which raised the issue mentioned. I think it's required that the editors can view the unpublished page before they can reference it, so you'll need to check editor permissions.

@andybroomfield
Copy link
Contributor

I think that this is code that locks it to published nodes unless user has access

// Adding the 'node_access' tag is sadly insufficient for nodes: core
// requires us to also know about the concept of 'published' and
// 'unpublished'. We need to do that as long as there are no access control
// modules in use on the site. As long as one access control module is
// there, it is supposed to handle this check.
if (!$this->currentUser->hasPermission('bypass node access') && !$this->moduleHandler->hasImplementations('node_grants')) {
$query->condition('status', NodeInterface::PUBLISHED);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants