You are here

function _social_album_create_post in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/social_album.module \_social_album_create_post()
  2. 10.0.x modules/social_features/social_album/social_album.module \_social_album_create_post()
  3. 10.2.x modules/social_features/social_album/social_album.module \_social_album_create_post()

Open post creation form after saving the album node.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

1 string reference to '_social_album_create_post'
social_album_form_node_album_form_alter in modules/social_features/social_album/social_album.module
Implements hook_form_FORM_ID_alter().

File

modules/social_features/social_album/social_album.module, line 442
The Social Album module.

Code

function _social_album_create_post(array $form, FormStateInterface $form_state) {
  if ($form_state
    ->getRedirect()) {
    $form_state
      ->setRedirect('social_album.post', [
      'node' => $form_state
        ->getFormObject()
        ->getEntity()
        ->id(),
    ]);
  }
}