Skip to content
Snippets Groups Projects
Commit bb29cd57 authored by Dylan Donkersgoed's avatar Dylan Donkersgoed Committed by Dylan Donkersgoed
Browse files

Issue #2834206 by myLies, Dylan Donkersgoed: Rabbit Hole users setting form...

Issue #2834206 by myLies, Dylan Donkersgoed: Rabbit Hole users setting form does not reflect settings after save
parent e14a65e0
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,6 @@ class BehaviorSettingsManager implements BehaviorSettingsManagerInterface {
* {@inheritdoc}
*/
public function saveBehaviorSettings($settings, $entity_type_id, $entity_id = NULL) {
$id = $this->generateBehaviorSettingsFullId($entity_type_id, $entity_id);
$entity = BehaviorSettings::load($id);
......
......@@ -286,7 +286,7 @@ class FormManglerService {
?: BehaviorSettings::REDIRECT_NOT_APPLICABLE,
),
$form_state->getValue('rh_entity_type'),
isset($entity) ? $entity->id() : $form_state->getValue('rh_entity_type')
isset($entity) ? $entity->id() : NULL
);
}
}
......
......@@ -219,19 +219,17 @@ class PageRedirect extends RabbitHoleBehaviorPluginBase implements ContainerFact
$redirect = NULL;
$redirect_code = NULL;
if (isset($entity)) {
if ($entity_is_bundle) {
$redirect = $bundle_settings->get('redirect');
$redirect_code = $bundle_settings->get('redirect_code');
}
else {
$redirect = isset($entity->rh_redirect->value)
? $entity->rh_redirect->value
: self::RABBIT_HOLE_PAGE_REDIRECT_DEFAULT;
$redirect_code = isset($entity->rh_redirect_code->value)
? $entity->rh_redirect_code->value
: self::RABBIT_HOLE_PAGE_REDIRECT_RESPONSE_DEFAULT;
}
if ($entity_is_bundle) {
$redirect = $bundle_settings->get('redirect');
$redirect_code = $bundle_settings->get('redirect_code');
}
elseif (isset($entity)) {
$redirect = isset($entity->rh_redirect->value)
? $entity->rh_redirect->value
: self::RABBIT_HOLE_PAGE_REDIRECT_DEFAULT;
$redirect_code = isset($entity->rh_redirect_response->value)
? $entity->rh_redirect_response->value
: self::RABBIT_HOLE_PAGE_REDIRECT_RESPONSE_DEFAULT;
}
else {
$redirect = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment