Problem/Motivation

If you go to content type configuration page and disable "Allow these settings to be overridden for individual entities" option, Rabbit hole options will still appear on the node edit form for that content type.

Proposed resolution

See attached patch for a proposed fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

temkin created an issue. See original summary.

temkin’s picture

Status: Active » Needs review
FileSize
2.24 KB

Here is a patch to address that

adamzimmermann’s picture

+++ b/src/FormManglerService.php
@@ -182,7 +185,6 @@ class FormManglerService {
-      $allow_override = $bundle_settings->get('allow_override');

I'm not sure how moving this factors into this patch since it doesn't use this variable. However, if we are going to move it, why not just do this and remove the variable completely since it is only used once.

'#default_value' => $bundle_settings->get('allow_override'),

Additionally, I tried out the patch and it seems to work great, so that's the important thing.

Dylan Donkersgoed’s picture

I've attached a rerolled version of the patch with adamzimmerman's suggested change included and also another patch that builds on it which:

  • Ensures that if a user visits a node with custom settings when override is disabled the bundle settings are still invoked
  • Fixes a test that didn't set the allow_override bundle and therefore failed with this change

I'm leaving it here for review for now but I'll commit it in a few days if there are no objections.

Dylan Donkersgoed’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.