function drupal_requirements_url

Same name and namespace in other branches
  1. 11.x core/includes/install.inc \drupal_requirements_url()
  2. 10 core/includes/install.inc \drupal_requirements_url()
  3. 9 core/includes/install.inc \drupal_requirements_url()
  4. 8.9.x core/includes/install.inc \drupal_requirements_url()
  5. 7.x includes/install.inc \drupal_requirements_url()

Returns a URL for proceeding to the next page after a requirements problem.

This function can be called by low-level scripts (such as install.php and update.php) and returns a URL that can be used to attempt to proceed to the next step of the script.

Parameters

int|\Drupal\Core\Extension\Requirement\RequirementSeverity $severity: The severity of the requirements problem, as returned by drupal_requirements_severity().

Return value

string A URL for attempting to proceed to the next step of the script. The URL is not sanitized, so it still needs to be run through \Drupal\Component\Utility\UrlHelper::filterBadProtocol() if it will be used as an HTML attribute value.

See also

drupal_current_script_url()

\Drupal\Component\Utility\UrlHelper::filterBadProtocol()

1 call to drupal_requirements_url()
install_display_requirements in core/includes/install.core.inc
Displays installation requirements.

File

core/includes/install.inc, line 597

Code

function drupal_requirements_url($severity) : string {
  if (!$severity instanceof RequirementSeverity) {
    @trigger_error('Passing a type other than ' . RequirementSeverity::class . ' to ' . __FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Pass a ' . RequirementSeverity::class . ' enum instead. See https://www.drupal.org/node/3410939', E_USER_DEPRECATED);
    $severity = RequirementSeverity::from($severity);
  }
  if (is_null($severity)) {
    $severity = RequirementSeverity::Info;
  }
  $query = [];
  // If there are no errors, only warnings, append 'continue=1' to the URL so
  // the user can bypass this screen on the next page load.
  if ($severity === RequirementSeverity::Warning) {
    $query['continue'] = 1;
  }
  return drupal_current_script_url($query);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.