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

Created on 8 October 2022, over 2 years ago
Updated 11 August 2024, 9 months ago

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
  • Moved to contrib
  • 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

📌 Task
Status

Fixed

Version

10.3

Component
Other 

Last updated 2 days ago

Created by

🇮🇳India rakesh.drupal Delhi

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024