Using this module:

steps to reproduce:

  1. Edit a field
  2. chose: enable for certain roles
  3. select multiple roles
  4. save field settings

Following trace error appears and the field is not hidden for roles not selected.

Notice: Undefined index: add_enable in disable_field_disable_validate() (line 172 of modules/contrib/disable_field/disable_field.module).
disable_field_disable_validate(Array, Object)
call_user_func_array('disable_field_disable_validate', Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'field_config_edit_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('field_config_edit_form', Array, Object) (Line: 576)
Drupal\Core\Form\FormBuilder->processForm('field_config_edit_form', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
CommentFileSizeAuthor
#3 3078638-3.patch3.47 KBmartijn de wit

Comments

Martijn de Wit created an issue. See original summary.

martijn de wit’s picture

Title: Enable for certain roles does not work » Enable & disable does not work due error's
martijn de wit’s picture

Status: Active » Needs review
StatusFileSize
new3.47 KB

Fixed some naming faults that where causing the error.

martijn de wit’s picture

@maintainer, can you please enable tests for this module? :)

martijn de wit’s picture

Maybe this issue is related?

mrtndlmt’s picture

Hi,

This patch works for me! +1

M.

jeroent’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-2.x. Thanks!

jeroent’s picture

Status: Fixed » Closed (fixed)

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