t() calls should avoided in class

Created on 3 March 2023, almost 2 years ago
Updated 9 March 2023, almost 2 years ago

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India gayatri chahar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • Issue created by @gayatri chahar
  • 🇮🇳India gayatri chahar

    Patch created. Please review it
    Thanks

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work almost 2 years ago
  • 🇮🇳India Adil_Siddiqui

    Below t() call is still left in

    FILE: /Users/adil.shiddiqui/drupal9/web/modules/contrib/augmentor/src/Plugin/Field/FieldWidget/AugmentorBaseWidget.php

    306 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead

    Also other phpcs errors is also present:

    FILE: /Users/adil.shiddiqui/drupal9/web/modules/contrib/augmentor/src/Plugin/Field/FieldWidget/AugmentorBaseWidget.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------
    74 | WARNING | Unused variable $yolo.
    87 | WARNING | File::load calls should be avoided in classes, use dependency injection instead
    306 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    367 | WARNING | Unused variable $field_name.
    ------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/adil.shiddiqui/drupal9/web/modules/contrib/augmentor/src/Plugin/Field/FieldWidget/AugmentorWidget.php
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------------------------
    82 | WARNING | Unused variable $yolo.
    94 | WARNING | File::load calls should be avoided in classes, use dependency injection instead
    324 | WARNING | Unused variable $field_name.
    ------------------------------------------------------------------------------------------------------------------

    FILE: /Users/adil.shiddiqui/drupal9/web/modules/contrib/augmentor/src/Plugin/Field/FieldFormatter/AugmentorFormatter.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------------
    64 | WARNING | Unused variable $debug.
    65 | WARNING | Unused variable $entity.
    ------------------------------------------------------------------------------------------------------------------------

  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India Adil_Siddiqui

    Patch created to solve #3 issues.

  • Status changed to RTBC almost 2 years ago
  • The attached patch also accommodated 📌 Fix typo mistake in AugmentorInterface.php Closed: duplicate

  • Ignore the previous patch. It was of some other issue

  • Status changed to Fixed almost 2 years ago
  • Patch has been committed and merged to 1.0.x

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024