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

Book outline is available for other content types #83

Open
finnlewis opened this issue Jun 29, 2023 · 5 comments
Open

Book outline is available for other content types #83

finnlewis opened this issue Jun 29, 2023 · 5 comments
Assignees

Comments

@finnlewis
Copy link
Member

finnlewis commented Jun 29, 2023

When creating a service page, I can add this to a book outline.

We think this is not desirable.

Image

@andybroomfield
Copy link

andybroomfield commented Jun 29, 2023

can you check with the editor only permission. I think admins can add any page to a book.

Looks like the permission is avalible to all, might need a split permission and a form_alter hook

@rupertj
Copy link
Member

rupertj commented Nov 15, 2023

I agree that this isn't desirable, but also, part of the plan for this module was to not interfere with how book module works, in case people want to use it.

Isn't this field being present on all the content types how book works? We could remove that field on the other content types, but we'd be deviating from the plan of not interfering with book.

I wonder if having a setting along the lines of "Let me use book for other things too please" would be a good idea? Then we could hide things book does from people who only want to use publications, and still let people who want to use book, use it how they did before they installed publications.

@rupertj
Copy link
Member

rupertj commented Mar 6, 2024

image

Lizzi from Bracknell posted this in slack today, with the question "If I create a publication cover, then pages within that publication, how do we then link to the first page of the publication as wouldn't that then be linking to the cover page."

I think she's ended up where she is from putting the cover page in the publication (possibly even creating the publication from the cover page) and then linking to a page in the publication with the reference field.

I think hiding the Publication/Book fieldset from all content types bar Publication Page, with a setting to stop that happening in case people want to use Book would make the UI more intuitive.

@rupertj
Copy link
Member

rupertj commented Mar 7, 2024

So this happens because we grant the "administer book outlines" permission to Editors by default. That permission also lets you add any content type to a book. Users without that permission can only add certain content types (Set at /admin/structure/book/settings) to books.

So we should:

  1. Stop granting that permission and either a) communicate to site owners that they should remove the permission or b) remove it in an update hook.

  2. Change anywhere we're using that permission for our own devices. It's used in the routing file to allow access to the publications listing at least.

@AWearring
Copy link
Contributor

@rupertj @andybroomfield
I found that removing the "administer book outlines" permission caused errors/warnings on the Publication Cover page Add/Edit forms:
image

Removing

'node_localgov_publication_cover_page_form',
'node_localgov_publication_cover_page_edit_form',

from $forms_to_alter in the localgov_publications_form_alter() function in localgov_publications.module resolves this.

Not sure if that adversely effects anything, but this solves the issue raised by @finnlewis

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

No branches or pull requests

4 participants