Add field for store redirect url after update or store.

@return void
496564
protected function addRedirectUrlField()
    {
        $previous = URL::previous();

        if (!$previous || $previous == URL::current()) {
            return;
        }

        if (Str::contains($previous, url($this->getResource()))) {
            $this->addHiddenField((new Form\Field\Hidden(static::PREVIOUS_URL_KEY))->value($previous));
        }
    }
424732
protected function wizardAddStore()
    {
        $this->validatePrompt('name', $this->text('Name'), 'store');
        $this->validatePrompt('domain', $this->text('Domain or IP'), 'store');
        $this->validatePrompt('basepath', $this->text('Path'), 'store', '');
        $this->validatePrompt('status', $this->text('Status'), 'store', 0);
        $this->setSubmittedJson('data');

        $this->validateComponent('store');
        $this->addStore();
    }
625777
protected function registerRedirect()
    {
        $this->app->singleton('redirect', function ($app) {
            $redirect = new Redirector($app['url']);

            $redirect->setSession($app['session']);

            return $redirect;
        });
    }
1145330
protected function registerRedirection(): void
    {
        if (! empty($this->redirectAfterInstalled) && \is_string($this->redirectAfterInstalled)) {
            Installation::$redirectAfterInstalled = $this->redirectAfterInstalled;
        }
    }
1050632
public function afterLoginRedirect()
    {
        $redirect = $this->getRequest()->query->get(
            'redirect',
            $this->Url()->default()
        );

        $this->flashRedirect(
            $this->getModelManager()->getMessage('login-success'),
            $redirect,
            'success',
            'index'
        );
    }
1232309
protected function registerRedirector()
	{
		$this->app['redirect'] = $this->app->share(function($app)
		{
			$redirector = new Redirector($app['url']);

			// If the session is set on the application instance, we'll inject it into
			// the redirector instance. This allows the redirect responses to allow
			// for the quite convenient "with" methods that flash to the session.
			if (isset($app['session.store']))
			{
				$redirector->setSession($app['session.store']);
			}

			return $redirector;
		});
	}
48834
private function redirect()
    {
        if ($this->config['sandbox']) {
            $this->endpoint_redirect = $this->sandbox_endpoint_redirect;
        }
        $key1 = $this->config['app_key1'];
        $key2 = $this->config['app_key2'];
        $param = array(
            'AuthCode' => $this->auth_code,
            'facId'    => $this->config['app_id'],
            'facMemId' => $this->parameter['userId'],
            'hash'     => hash('sha256',
                "{$key1}{$this->auth_code}{$this->config['app_id']}{$this->parameter['userId']}{$key2}")
        );
        $this->endpoint_redirect .= '?' . http_build_query($param);
        header('Location:' . $this->endpoint_redirect);
        exit();
    }
1325411
protected function addProduct()
    {
        $this->controlAccess('product_add');

        if ($this->product->add($this->getSubmitted())) {
            $this->redirect('admin/content/product', $this->text('Product has been added'), 'success');
        }

        $this->redirect('', $this->text('Product has not been added'), 'warning');
    }
9785
public function redirectCustomerToPaymentProvider() {
    if (isset($this->response['redirect'])) {
      header('location:' . $this->response['redirect']);
      exit;
    }
    elseif (isset($this->response['url'])) {
      header('location:' . $this->response['url']);
      exit;
    }
  }
65322
private function updateUriQuery(): void
    {
        $sort = [];
        foreach ($this->order as $field => $direction) {
            if ($direction === self::ORDER_ASC) {
                $sort[] = $field;
            } elseif ($direction === self::ORDER_DESC) {
                $sort[] = '-' . $field;
            }
        }

        $fields = [];
        foreach ($this->fields as $type => $fields) {
            $fields[$type] = implode(',', $fields);
        }

        $query = [
            'sort' => implode(',', $sort),
            'pagination' => $this->pagination,
            'filter' => $this->filter,
            'include' => implode(',', $this->includes),
            'fields' => $fields
        ];

        $this->uri = $this->uri()->withQuery(http_build_query($query));
    }
896400
public function add()
    {
        $this->request->allowMethod(['get', 'post']);

        $menu = $this->Menus->newEntity();
        if ($this->request->is('post') && !empty($this->request->data)) {
            $this->Menus->patchEntity($menu, $this->request->data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been created.', $this->request->data['name']));
                $this->redirect(['action' => 'index']);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set('menu', $menu);
    }
648860
public function addRedirect($postValues)
    {
        $redirectObject = RedirectsFactory::createRedirectFromPostValues($postValues);
        $redirects = $this->repository->redirects;
        $redirects[] = $redirectObject;
        $this->repository->redirects = $redirects;
        $this->save();
    }
1043001
private function searchRedirect(): void
    {
        // calculated depend of language
        $pathway = $this->getPathInfo();
        /** @var array $routing */
        $routing = App::$Properties->getAll('Routing');

        if (!Any::isArray($routing) || !isset($routing['Redirect']) || !Any::isArray($routing['Redirect'])) {
            return;
        }

        // check if source uri is key in redirect target map
        if (array_key_exists($pathway, $routing['Redirect'])) {
            $target = $this->getSchemeAndHttpHost(); // . $this->getBasePath() . '/' . rtrim($routing['Redirect'][$pathway], '/');
            if ($this->getBasePath() !== null && !Str::likeEmpty($this->getBasePath())) {
                $target .= '/' . $this->getBasePath();
            }
            $target .= rtrim($routing['Redirect'][$pathway], '/');
            $redirect = new RedirectResponse($target);
            $redirect->send();
            exit();
        }
    }
670370
public function addFields() {
    $this->logger->info('addFields() invoked to add newly added base fields to SKU.');
    // Get all the additional fields from all custom modules.
    $fields = $this->getAllCustomFields();

    // Store the fields in config.
    $config = $this->configFactory->getEditable(self::BASE_FIELD_ADDITIONS_CONFIG);
    $existing_fields = $config->getRawData();

    $fields = array_diff_key($fields, $existing_fields);
    $existing_fields = array_merge($existing_fields, $fields);
    $config->setData($existing_fields)->save();

    if ($fields) {
      $this->logger->info('Adding new fields %fields.', [
        '%fields' => json_encode($fields),
      ]);

      // Apply entity updates, we will read from config and add/update fields.
      $this->entityDefinitionUpdateManager->applyUpdates();

      // Allow other modules to take some action after the fields are added.
      $this->moduleHandler->invokeAll('acm_sku_base_fields_updated', [$fields, 'add']);
    }
    else {
      $this->logger->warning('No new fields found to add.');
    }

  }
1094294
protected function mergeRedirect()
    {
        if (!empty($this->redirect)) {
            $this->data = array_merge_recursive($this->data, array('redirect_uri' => $this->redirect));
        }
    }
1307864
protected function redirectByAction()
    {
        $params = $this->request->getArguments();
        $formAction = $params["formAction"];
        $arguments = array();
        if ($params["storage"]["type"] == "pages") {
            $arguments["layoutIdentifier"] = $this->backendLayoutRepository->findByIdentifier($params["storage"]["elements"]["key"],
                explode(",", $this->extSettings['backendlayout_pids']))->getIdentifier();
        } else {
            $arguments["key"] = $params["storage"]["elements"]["key"];
            $arguments["type"] = $params["storage"]["type"];
        }
        if (key_exists("save", $formAction)) {
            $this->redirect('edit', null, null, $arguments);
        } else {
            if (key_exists("saveAndExit", $formAction)) {
                $this->redirect('list');
            }
        }
    }
332842
public function addAction()
    {
        $parent = $this->params()->fromRoute('parent');
        if (! is_numeric($parent)) {
            $this->flashMessenger()->addMessage(
                $this->scTranslate('The article location was not specified.')
            );
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }
        try {
            $articleId = $this->getArticleService()->makeArticle($parent);
        } catch (RuntimeException $e) {
            $this->flashMessenger()->addMessage($e->getMessage());
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }

        return $this->redirect()->toRoute(
            'sc-admin/article/edit',
            ['id' => $articleId]
        );
    }