Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293752

Replace t() calls inside of Controllers that do not use StringTranslationTrait

$
0
0

Problem/Motivation

I was reviewing the code of SystemController.php and noticed that there was a procedural t() function instead of $this->t() which is not a best practice to use inside a controller.

$admin_theme_options[$theme->getName()] = $theme->info['name'] . ($theme->isExperimental() ? ' (' . t('Experimental') . ')' : '');

Steps to reproduce

Proposed resolution

Fix Controllers in non tests for the sniff 'Drupal.Commenting.DocComment.ShortSingleLine'
That should be these files

  • core/modules/views_ui/src/Controller/ViewsUIController.php
  • core/modules/book/src/Controller/BookController.php Moved to contrib
  • core/modules/tracker/src/Controller/TrackerController.php Moved to contrib
  • core/modules/system/src/Controller/SystemController.php
  • core/modules/update/src/Controller/UpdateController.php

Remaining tasks

review
commit

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>