Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When the options tabs are hidden, adding a node through the node form defaults to not published, regardless of the default publish setting for the content type. However when I show them again and save, it is published, I'm not sure why hiding part of the form would effect this but I tested extensively and it does.
Comment | File | Size | Author |
---|---|---|---|
#7 | published_status-1388514-7.patch | 1.03 KB | asherry |
#6 | nodeformcols-1388514-6.patch | 718 bytes | ss81 |
Comments
Comment #1
najibx CreditAttribution: najibx commentedThis is what is happening. subscribing.
Comment #2
El Bandito CreditAttribution: El Bandito commentedYes, I'm seeing this as well. To elaborate when I hide the vertical tabs field, then edit and save a page its status becomes unpublished despite the fact it was previously published and I had no access to the checkbox to unpublish it.
Happy to test any suggested fixes.
El B
Comment #3
aggentle CreditAttribution: aggentle commentedLikewise. Any advice or workarounds appreciated. Can the Publishing tab be shown but "hidden"?
Comment #4
gazelemone CreditAttribution: gazelemone commentedHas anyone found a way to solve this? I would also be happy to test any patches.
Comment #5
aggentle CreditAttribution: aggentle commentedI implemented a workaround for this by including the following css code in my subtheme. You will need to inspect the webpage elements of your site to check that the class is correct for the revision field - in this case it is form-item-revision, but it may be different for your theme.
So although the revision box is included in the HTML page (and therefore will pick up the default setting that we want), it does not appear on the page and cannot be changed by an end user.
This only hides the revision box, which doesn't stop someone from hacking the revision setting on a form submit if they knew what they were doing. However, for end users this gets around the problem.
Comment #6
ss81 CreditAttribution: ss81 commentedAttached patch helped me to solve this issue in Drupal7
Comment #7
asherry CreditAttribution: asherry commentedI'm tempted to mark this as 'works as designed'. Does anybody have a use case for hiding the tabs with nodeformcols? These are the ['additional_settings'] for a node, they're hidden automatically for any user without the permission "administer content".
I actually think we should disable the ability to hide "Vertical Tabs" in nodeformcols, as it shouldn't be an option in the first place.
If there is a use case though, I'd still want to go with a different approach. We shouldn't use wrapper html for all additional settings, they shouldn't be rendered. What we'll have to do is iterate through the child elements of additional_settings and set the #access for those individual elements to FALSE. I attached a patch to show you what I mean, but what's in that patch really should be implemented in a custom module if really needed.
Comment #8
asherry CreditAttribution: asherry commentedLet's go ahead and test this patch, we should fix the bug first before talking about disabling that feature.
Comment #9
asherry CreditAttribution: asherry commentedI'd like to get somebody from the community to test this, anybody out there want to test it out and mark it RTBC?
Comment #10
ss81 CreditAttribution: ss81 commentedBy default node has 3 virtual tabs: Revision information, Authoring information, Publishing options.
What if I want to hide all except "Publishing options" to make UI more simple for users? With recent dev release I can hide only all tabs, which, I guess, is not so helpful as it was before.
Comment #11
ss81 CreditAttribution: ss81 commentedThe patch attached to #7 works well for me.
Comment #12
ss81 CreditAttribution: ss81 commentedWith recent patch only virtual tabs could be hidden, but module doesn't work for other fields.
Comment #13
Leeteq CreditAttribution: Leeteq commentedFYI - Posted the suggestion in #10 as a new feature request:
#2399973: Allow per-item visibility control of the Vertical tabs
Comment #14
nithinkolekar CreditAttribution: nithinkolekar commented#12 confirmed. Other fields like body are still visible when it is set to hidden.
I think there is something wrong with published tab only, because other tab setting like comment, author information is retaining there default setting from content type configuration.