Loading entity_redirect.info.yml +1 −0 Original line number Diff line number Diff line Loading @@ -2,4 +2,5 @@ name: 'Entity Redirect' type: module description: 'Redirect after entity creation or edit - per content or user.' core: 8.x core_version_requirement: ^8 || ^9 package: entity No newline at end of file entity_redirect.module +3 −3 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ function entity_redirect_form_alter(&$form, FormStateInterface $form_state, $for $entity = $form_state->getFormObject()->getEntity(); $bundle = $entity->bundle(); $entity_type = entity_load($type, $bundle); $entity_type = \Drupal::service('entity_type.manager')->getStorage($type)->load($bundle); if (!$entity->isNew() && !$entity_type->getThirdPartySetting('entity_redirect', 'redirect_edit')) { return; } Loading Loading @@ -162,7 +162,7 @@ function entity_redirect_submit($form, FormStateInterface $form_state) { $entity = $form_state->getFormObject()->getEntity(); $bundle = $entity->bundle(); $entity_type = entity_load($type, $bundle); $entity_type = \Drupal::service('entity_type.manager')->getStorage($type)->load($bundle); if ($entity_type->getThirdPartySetting('entity_redirect', 'personalizable')) { if ($user_id = \Drupal::currentUser()->id() && \Drupal::currentUser()->hasPermission('use personalized redirect options')) { $personalization = $entity_type->getThirdPartySetting('entity_redirect', 'personalization'); Loading Loading @@ -358,7 +358,7 @@ function entity_redirect_user_profile_form_submit($form, FormStateInterface $for $user_id = $form_state->getFormObject()->getEntity()->id(); foreach ($form_state->getValue('entity_options') as $type => $bundles) { foreach ($bundles as $bundle => $data) { $bundle = entity_load($type, $bundle); $bundle = \Drupal::service('entity_type.manager')->getStorage($type)->load($bundle); $settings = $bundle->getThirdPartySetting('entity_redirect', 'personalization', []); $settings[$user_id] = [ 'destination' => $data['destination'], Loading Loading
entity_redirect.info.yml +1 −0 Original line number Diff line number Diff line Loading @@ -2,4 +2,5 @@ name: 'Entity Redirect' type: module description: 'Redirect after entity creation or edit - per content or user.' core: 8.x core_version_requirement: ^8 || ^9 package: entity No newline at end of file
entity_redirect.module +3 −3 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ function entity_redirect_form_alter(&$form, FormStateInterface $form_state, $for $entity = $form_state->getFormObject()->getEntity(); $bundle = $entity->bundle(); $entity_type = entity_load($type, $bundle); $entity_type = \Drupal::service('entity_type.manager')->getStorage($type)->load($bundle); if (!$entity->isNew() && !$entity_type->getThirdPartySetting('entity_redirect', 'redirect_edit')) { return; } Loading Loading @@ -162,7 +162,7 @@ function entity_redirect_submit($form, FormStateInterface $form_state) { $entity = $form_state->getFormObject()->getEntity(); $bundle = $entity->bundle(); $entity_type = entity_load($type, $bundle); $entity_type = \Drupal::service('entity_type.manager')->getStorage($type)->load($bundle); if ($entity_type->getThirdPartySetting('entity_redirect', 'personalizable')) { if ($user_id = \Drupal::currentUser()->id() && \Drupal::currentUser()->hasPermission('use personalized redirect options')) { $personalization = $entity_type->getThirdPartySetting('entity_redirect', 'personalization'); Loading Loading @@ -358,7 +358,7 @@ function entity_redirect_user_profile_form_submit($form, FormStateInterface $for $user_id = $form_state->getFormObject()->getEntity()->id(); foreach ($form_state->getValue('entity_options') as $type => $bundles) { foreach ($bundles as $bundle => $data) { $bundle = entity_load($type, $bundle); $bundle = \Drupal::service('entity_type.manager')->getStorage($type)->load($bundle); $settings = $bundle->getThirdPartySetting('entity_redirect', 'personalization', []); $settings[$user_id] = [ 'destination' => $data['destination'], Loading