-
Notifications
You must be signed in to change notification settings - Fork 2
Added PreviewLinkAutopopulate plugin to auto-populate preview links #146
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
Conversation
Is there something else that needs to be done other than checking out the branch. I've got it, and done a site install, and used demo, but I don't see the button, only one to copy the preview link. Also is it intentionally only getting the next level of child pages, or should it be getting all child pages (using the Nested Storage)? |
I missed that subsite pages can also be parents along with overviews, I'll have to update to logic to handle this. |
@stephen-cox working on this today |
@ekes I have updated this PR to use Entity Hierarchy to load the nodes in a subsite; which is frankly a pain to work with. Loading all nodes is not straightforward so I've added a test. Would be nice to get this reviewed before Next Tuesday, if possible, as it's been hanging around for a while now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the rest that works.
|
||
$storage = $this->getNestedSetStorage('localgov_subsites'); | ||
$node_key = $this->getNestedSetNodeKeyFactory()->fromEntity($node); | ||
if ($ancestors = $storage->findAncestors($node_key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be $storage->findRoot($node_key) which does much the same.
It's just get root, get all ancestors of root, and load them? Seems straightforward to me. Pain I found is the way that NestedSet class has be abstracted so you don't get code completion (or I don't anyway). |
Part of localgovdrupal/localgov#600