addWorkspaceValidation example


  public function formAlter(array &$form, FormStateInterface $form_state$form_id) {
    // No alterations are needed if we're not in a workspace context.     if (!$this->workspaceManager->hasActiveWorkspace()) {
      return;
    }

    // Add an additional validation step for every form if we are in a     // non-default workspace.     $this->addWorkspaceValidation($form);

    // If a form has already been marked as safe or not to submit in a     // non-default workspace, we don't have anything else to do.     if ($form_state->has('workspace_safe')) {
      return;
    }

    // No forms are safe to submit in a non-default workspace by default, except     // for the whitelisted ones defined below.     $workspace_safe = FALSE;

    
Home | Imprint | This part of the site doesn't use cookies.