Rabbit Hole users setting form does not reflect settings after save.

Steps to reproduce:

  1. Enable rh_user module
  2. visit /admin/config/people/accounts and adjust the Rabbit Hole Settings

Expected:
After form save, Rabbit Hole Settings should reflect options entered prior to form save.

Actual:
After form save, Rabbit Hole Settings should default settings regardless of selected option.

Also, note if you had configured rh_users to use a Page Redirect in the above scenario, attempting to do so will result in:

Drupal\rabbit_hole\Exception\InvalidRedirectResponseException: in Drupal\rabbit_hole\Plugin\RabbitHoleBehaviorPlugin\PageRedirect->performAction() (line 207 of modules/contrib/rabbit_hole/src/Plugin/RabbitHoleBehaviorPlugin/PageRedirect.php).

Drupal\rabbit_hole\BehaviorInvoker->processEntity(Object, NULL) (Line: 91)
Drupal\rabbit_hole\EventSubscriber\RabbitHoleSubscriber->processEvent(Object) (Line: 50)
Drupal\rabbit_hole\EventSubscriber\RabbitHoleSubscriber->onRequest(Object, 'kernel.request', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 125)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

bonus created an issue. See original summary.

mylies’s picture

StatusFileSize
new579 bytes

Looks like when submitted form used addRabbitHoleOptionsToGlobalForm() method from FormManglerService class
it's try to save data to configs by entity_type_id and entity_id - something like "user_user", but when this (usually it's configuration form)form rendered - it's try to load data by only entity_type_id - so, now it use default settings always

I made a patch for that, and it works for me - but when you use redirect mode the "Response code" option still doesnt work and always get 301 status
The reason of that - in settingsForm() method from PageRedirect class - and I still in the dark why entity doesn't get response code, but XDebug show me - it exist in object

Hope that helps

P. S. I hope I haven't made too many mistakes in the text =)

mylies’s picture

Status: Active » Needs review
mylies’s picture

Status: Needs review » Active

oh, no
it's still active

CatherineOmega’s picture

Hmm, that fix lets me save the checkboxes, just not the contents of "Redirect path".

dylan donkersgoed’s picture

Status: Active » Needs review
StatusFileSize
new2.91 KB

I've attached a patch that should fix both issues.

  • Dylan Donkersgoed committed bb29cd5 on 8.x-1.x
    Issue #2834206 by myLies, Dylan Donkersgoed: Rabbit Hole users setting...
dylan donkersgoed’s picture

I've merged this into the dev branch. I didn't end up using your patch (the name is actually built inside that service so it needed to be updated a bit differently) but I did credit you on the commit since aside from that you pretty much fixed the first problem.

dylan donkersgoed’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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