- Issue created by @Pawelgorski87
- Status changed to Needs review
11 months ago 2:56pm 14 December 2023
Redirect dosnt' work return dosn't work in form_alter
* Implements hook_form_alter().
*
* Permit posting of content.
*/
function readonlymode_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$settings = \Drupal::config('readonlymode.settings');
if (!_readonlymode_form_check($form, $form_id, FALSE)) {
// If a redirect URL is set, then we redirect to it.
if ($url = $settings->get('url')) {
return new RedirectResponse($url);
}
else {
setup link in redirect settings, go to see form.
Needs review
1.2
Code