function _drupal_get_filename_fallback_trigger_error
_drupal_get_filename_fallback_trigger_error($type, $name, $error_type)
Triggers a user-level warning for missing or unexpectedly moved files.
Parameters
$type: The type of the item (theme, theme_engine, module, profile).
$name: The name of the item for which the filename is requested.
$error_type: The type of the error ('missing' or 'moved').
See also
_drupal_get_filename_fallback()
File
- includes/bootstrap.inc, line 1073
- Functions that need to be loaded on every Drupal request.
Code
function _drupal_get_filename_fallback_trigger_error($type, $name, $error_type) { // Hide messages due to known bugs that will appear on a lot of sites. // @todo Remove this in https://www.drupal.org/node/2762241 if (empty($name) || ($type == 'module' && $name == 'default')) { return; } // Make sure we only show any missing or moved file errors only once per // request. static $errors_triggered = array(); if (empty($errors_triggered[$type][$name][$error_type])) { // Use _drupal_trigger_error_with_delayed_logging() here since these are // triggered during low-level operations that cannot necessarily be // interrupted by a watchdog() call. if ($error_type == 'missing') { _drupal_trigger_error_with_delayed_logging(format_string('The following @type is missing from the file system: %name. In order to fix this, put the @type back in its original location. For more information, see <a href="@documentation">the documentation page</a>.', array('@type' => $type, '%name' => $name, '@documentation' => 'https://www.drupal.org/node/2487215')), E_USER_WARNING); } elseif ($error_type == 'moved') { _drupal_trigger_error_with_delayed_logging(format_string('The following @type has moved within the file system: %name. In order to fix this, clear caches or put the @type back in its original location. For more information, see <a href="@documentation">the documentation page</a>.', array('@type' => $type, '%name' => $name, '@documentation' => 'https://www.drupal.org/node/2487215')), E_USER_WARNING); } $errors_triggered[$type][$name][$error_type] = TRUE; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/_drupal_get_filename_fallback_trigger_error/7.x