Closed (fixed)
Project:
Access unpublished
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2017 at 11:29 UTC
Updated:
11 Dec 2025 at 07:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hctomHere is a patch that filters out entity delete forms for displaying the unpublished access form elements. It may be extended with more form handler keys in the future
Comment #3
chr.fritschWe recently added some similar functionality in content lock #2916747: Consider the form operation when locking. I think it would be much nicer.
Comment #4
moshe weitzman commentedStill an issue. Happens on the form for https://www.drupal.org/docs/contributed-modules/scheduled-transitions module as well. Can we limit the alter to just the edit form?
Comment #5
chr.fritschMaybe the same as in #3207607: don't generate permissions for entity types that don't have a canonical link and check if the entity has the canonical link-template?
Comment #6
moshe weitzman commentedYeah, that would fix the problem we have on https://www.mass.gov. Any chance you can roll similar patch here?
Comment #7
chr.fritschI think my suggestion form #5 is only part of the solution here. @moshe could you review #3207607: don't generate permissions for entity types that don't have a canonical link, that should fix the problem at least for you
Comment #8
chr.fritschI had another idea. What about adding some config to entity form displays, where you can choose if the form should be displayed or not for this form?
Comment #9
hctomI'm not really sure what you mean by "adding some config to entity form displays", but isn't that what the "Manage Form display" settings are for?! So what about exposing the access unpublished element for that page, so it can be dragged to the position you want to have it... or moved to the "Disabled" section to remove it.
Comment #10
marcoscanoCame across this as well, where the element is being added in all confirmation forms (delete, replicate, etc). Not sure if I'm missing some scenarios, but here's a patch that takes a more opinionated and simplified approach, only displaying it on entity edit forms.
Comment #11
hctom@marcoscano Unfortunately it is not that easy, because form handler keys are totally up to the entity definition. Taxonomy terms for example don't have an
editform handler key and only use thedefaultkey. Nodes otherwise use bothdefaultandeditform handler keys.Comment #12
chr.fritschI think that adding a pseudo field with hook_entity_extra_field_info is the best option we have so far.
Comment #13
chrissnyderI re-rolled marcoscano's patch from #10 to work with the latest version. While this solution is not perfect, it does resolve the issue I experienced with the form showing on Scheduled Transitions node forms.
Comment #14
alexpottI've pushed a fix up to #3164509: Authenticated user can manage unpublished access tokens on node delete page that's pretty similar to the patch in #13 but copies code from the flag module. I think we should re-purpose this issue to do something similar to flag's
hook_entity_extra_field_info()so people can hide the form on specific entity type / bundles. Going to credit @ChrisSnyder, @marcoscano and @hctom on the other issue.Comment #15
mably commentedI think the problem is fixed in current version:
Closing for now. Feel free to reopen if I missed something.