Rabbit Hole users setting form does not reflect settings after save.
Steps to reproduce:
- Enable
rh_user module
- 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
Comment #2
mylies commentedLooks 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 =)
Comment #3
mylies commentedComment #4
mylies commentedoh, no
it's still active
Comment #5
CatherineOmega commentedHmm, that fix lets me save the checkboxes, just not the contents of "Redirect path".
Comment #6
dylan donkersgoed commentedI've attached a patch that should fix both issues.
Comment #8
dylan donkersgoed commentedI'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.
Comment #9
dylan donkersgoed commented