Skip to content
Snippets Groups Projects

Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS

Closed Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS
Closed Harumi Jang requested to merge issue/drupal-3238915:3238915-refactor-if-feasible into 9.3.x
6 files
+ 0
186
Compare changes
  • Side-by-side
  • Inline
Files
6
  • 886ca0b6
    Issue #3260780 by andypost: Remove deprecated code from common.inc · 886ca0b6
    catch authored
+ 0
73
@@ -9,7 +9,6 @@
*/
use Drupal\Component\Utility\Bytes;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SortArray;
use Drupal\Core\Cache\Cache;
use Drupal\Core\DrupalKernel;
@@ -346,47 +345,6 @@ function drupal_attach_tabledrag(&$element, array $options) {
$element['#attached']['library'][] = 'core/drupal.tabledrag';
}
/**
* Renders an element.
*
* This function renders an element. The top level element is shown with show()
* before rendering, so it will always be rendered even if hide() had been
* previously used on it.
*
* @param $element
* The element to be rendered.
*
* @return
* The rendered element.
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
* \Drupal\Core\Render\RendererInterface::render() instead.
*
* @see https://www.drupal.org/node/2939099
* @see \Drupal\Core\Render\RendererInterface
* @see show()
* @see hide()
*/
function render(&$element) {
@trigger_error('The render() function is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Render\RendererInterface::render() instead. See https://www.drupal.org/node/2939099', E_USER_DEPRECATED);
if (!$element && $element !== 0) {
return NULL;
}
if (is_array($element)) {
// Early return if this element was pre-rendered (no need to re-render).
if (isset($element['#printed']) && $element['#printed'] == TRUE && isset($element['#markup']) && strlen($element['#markup']) > 0) {
return $element['#markup'];
}
show($element);
return \Drupal::service('renderer')->render($element);
}
else {
// Safe-guard for inappropriate use of render() on flat variables: return
// the variable as-is.
return $element;
}
}
/**
* Hides an element from later rendering.
*
@@ -577,37 +535,6 @@ function _drupal_flush_css_js() {
Drupal::state()->set('system.css_js_query_string', base_convert(REQUEST_TIME, 10, 36));
}
/**
* Outputs debug information.
*
* The debug information is passed on to trigger_error() after being converted
* to a string using print_r() or var_export().
*
* @param $data
* Data to be output.
* @param $label
* Label to prefix the data.
* @param $print_r
* Flag to switch between print_r() and var_export() for data conversion to
* string. Set $print_r to FALSE to use var_export() instead of print_r().
* Passing recursive data structures to var_export() will generate an error.
*
* @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use dump()
* instead.
*
* @see https://www.drupal.org/node/3192283
*/
function debug($data, $label = NULL, $print_r = TRUE) {
@trigger_error('debug() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use dump() instead. See https://www.drupal.org/node/3192283', E_USER_DEPRECATED);
// Print $data contents to string.
$string = Html::escape($print_r ? print_r($data, TRUE) : var_export($data, TRUE));
// Display values with pre-formatting to increase readability.
$string = '<pre>' . $string . '</pre>';
trigger_error(trim($label ? "$label: $string" : $string));
}
/**
* Assembles the Drupal Updater registry.
*
Loading