- πΈπ°Slovakia poker10
Drupal 7 is now EOL. Moving back to Drupal 8 as Fixed, so that credits are assigned correctly. Thanks everyone!
When a form element of '#type' => 'vertical_tab'
has '#access' => FALSE
, none of the elements contained by that vertical tab are present in the submitted values.
The docs for #access
say:
Whether the element is accessible or not; when FALSE, the element is not rendered and the user submitted value is not taken into consideration.
They don't clarify what happens to the #default_value
, but after consulting chx and davereid on IRC, I was assured that the default values would still be in the submitted values:
davereid: I would assume any element output with #access = FALSE to still retain it's FAPI #default_value on submission.
Write a custom module called access_false.module, with the following code:
/**
* Implements hook_form_BASE_FORM_ID_alter() for node_form.
*/
function access_false_form_node_form_alter(&$form, &$form_state, $form_id) {
$form['additional_settings']['#access'] = FALSE;
}
And then try to save a node. It will be unpublished, regardless of the default publishing settings for that content type.
TBD
N/A
Any custom code relying on this bug (denying access to a vertical tab to suppress all values including defaults) will break.
Fixed
8.0 β°οΈ
forms system
Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.
After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Drupal 7 is now EOL. Moving back to Drupal 8 as Fixed, so that credits are assigned correctly. Thanks everyone!