You are here

function amp_node_form_submit_warnfix in Accelerated Mobile Pages (AMP) 7

Submit handler for viewing the AMP page with warnings/fixes messages

1 string reference to 'amp_node_form_submit_warnfix'
amp_form_node_form_alter in ./amp.module
Implements hook_form_BASE_FORM_ID_alter().

File

./amp.module, line 418

Code

function amp_node_form_submit_warnfix(&$form, $form_state) {
  if (!empty($form_state['node']->path['alias'])) {
    $current_path = $form_state['node']->path['alias'];
  }
  else {
    $current_path = 'node/' . $form_state['node']->nid;
  }

  // We need to remove destination if its there
  unset($_GET['destination']);

  // We must pass amp => null as there is no value to the amp parameter
  drupal_goto($current_path, array(
    'query' => array(
      'amp' => null,
      'warnfix' => null,
    ),
  ));
}