Find the best Rector rule to solve your problem. Searching through 1004 rules.

Found 5 rules, grouped by set: Clear

drupal/core 11.3 5 matches

Replace deprecated $variables['page'] with $variables['view_mode'] === 'full' in taxonomy term preprocess hooks.

 function mymodule_preprocess_taxonomy_term(array &$variables): void {
-  if ($variables['page']) {
+  if ($variables['view_mode'] === 'full') {
     $variables['show_title'] = FALSE;
   }
 }

Replace removed $dialog_options['dialogClass'] with $dialog_options['classes']['ui-dialog'] in OpenDialogCommand / OpenModalDialogCommand / OpenOffCanvasDialogCommand constructors (removed in drupal:12.0.0)

-new \Drupal\Core\Ajax\OpenDialogCommand('#my-dialog', 'Title', $content, ['dialogClass' => 'my-class', 'width' => 600]);
+new \Drupal\Core\Ajax\OpenDialogCommand('#my-dialog', 'Title', $content, ['width' => 600, 'classes' => ['ui-dialog' => 'my-class']]);

Remove RendererInterface::addCacheableDependency() calls where the dependency argument cannot implement CacheableDependencyInterface (bool, int, float, string, null, array). Such calls silently make pages uncacheable and are deprecated in drupal:11.3.0.

-$build = ['#markup' => 'Hello'];
-$this->renderer->addCacheableDependency($build, false);
+$build = ['#markup' => 'Hello'];

Replaces deprecated NodeStorage::revisionIds() and userRevisionIds() with entity queries; removes countDefaultLanguageRevisions() (no replacement)

-$storage->revisionIds($node);
+array_keys($storage->getQuery()->allRevisions()->condition('nid', $node->id())->accessCheck(FALSE)->execute());

Replaces deprecated ModuleHandler::loadAllIncludes() with getModuleList() + loadInclude() loop

-$this->moduleHandler->loadAllIncludes('install');
+foreach ($this->moduleHandler->getModuleList() as $module => $filename) {
+    $this->moduleHandler->loadInclude($module, 'install');
+}