- Issue created by @apmsooner
- 🇮🇳India vishal.kadam Mumbai
Thank you for applying! Reviewers will review the project files, describing what needs to be changed.
Please read Review process for security advisory coverage: What to expect → for more details and Security advisory coverage application checklist → to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
To reviewers: Please read How to review security advisory coverage applications → , What to cover in an application review → , and Drupal.org security advisory coverage application workflow → .
While this application is open, only the user who opened the application can make commits to the project used for the application.
Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.
- Status changed to Needs work
over 1 year ago 3:00pm 31 July 2023 - 🇮🇳India vinaymahale
Please fix the below PHPCS issues:
FILE: /custom_field/src/Plugin/Field/FieldWidget/CustomWidget.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 16 WARNINGS AFFECTING 16 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 116 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 162 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 163 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 164 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 165 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 179 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 180 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 181 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/Field/FieldWidget/CustomWidgetBase.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 85 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 93 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 105 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 124 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 127 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/Field/FieldFormatter/CustomInlineFormatter.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 55 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 81 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 100 | WARNING | Unused variable $name. ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/Field/FieldFormatter/CustomTableFormatter.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 28 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/Field/FieldFormatter/CustomListFormatter.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 44 | WARNING | #options values usually have to run through t() for translation 45 | WARNING | #options values usually have to run through t() for translation 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/Field/FieldFormatter/CustomTemplateFormatter.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 51 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/Field/FieldFormatter/CustomFormatter.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldType/Telephone.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 105 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 107 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 119 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 128 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 133 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 136 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 150 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 153 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/Email.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 75 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 89 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldType/FloatType.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 86 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldType/Text.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 104 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 118 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 124 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 127 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 132 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 135 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 149 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/Decimal.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 74 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldType/NumericBase.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 87 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 89 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 120 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 123 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 137 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/MapKeyValue.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 55 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 113 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 124 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 131 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 138 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 152 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 244 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 246 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 247 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/Url.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 78 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 85 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 105 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/Color.php ----------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------- 32 | WARNING | Unused variable $settings. ----------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldType/ListBase.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 109 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 119 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 120 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 129 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 166 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 180 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 200 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 202 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 203 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 204 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 258 | WARNING | Unused variable $key. ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/Textarea.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 101 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 109 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 120 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 131 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 140 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 145 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 150 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 151 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 157 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /custom_field/src/Plugin/CustomFieldType/Checkbox.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 67 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldType/Integer.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 81 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /custom_field/src/Plugin/CustomFieldTypeBase.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 133 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 139 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 154 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 155 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 162 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 163 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 170 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 172 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 173 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 189 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 191 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 192 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------
- 🇮🇳India vishal.kadam Mumbai
Remove LICENSE.txt file. It will be added automatically by the packaging script.
- Status changed to Needs review
over 1 year ago 4:46pm 31 July 2023 - 🇺🇸United States apmsooner
@ vinaymahale & vishal.kadam - pushed all suggested changes.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
The LICENSE.txt file is added to the archives, not to the repository.
Drupal Git Contributor Agreement & Repository Usage Policy → does not forbid to add a license file in a project repository; it just says that projects hosted on drupal.org are licensed under the same license used by Drupal core. As long as the license is correct, the file can stay.
- 🇺🇸United States apmsooner
Changing title to reflect the desired 2.x version for review. I can't put development on hold for this coveted role. I have gitlab pipelines running with passing tests for phpcs and have some unit testing in place to verify functionality. The module page has several screenshots to depict merit for using it and have provided documentation over and above the typical for unique features.
https://www.drupal.org/project/custom_field/releases/2.0.x-dev →
- 🇺🇸United States apmsooner
I am changing priority as per Issue priorities → .
- Status changed to Needs work
over 1 year ago 4:43pm 25 September 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
- What follows is a quick review of the project; it doesn't mean to be complete
- For each point, the review usually shows some lines that should be fixed (except in the case the point is about the full content of a file); it doesn't show all the lines that need to be changed for the same reason
- A review is about code that doesn't follow the coding standards, contains possible security issue, or doesn't correctly use the Drupal API; the single points aren't ordered, not even by importance
src/Feeds/Target/CustomField.php
catch (TargetValidationException $e) { // Validation failed. $this->messenger()->addError($e->getMessage());
The first parameter of
addError()
must be a translatable string.The annotation used for the field plugins is similar to the following one.
/** * Plugin implementation of the 'Map (Key Value)' custom field type. * * @CustomFieldType( * id = "map_key_value", * label = @Translation("Map (Key Value)"), * description = @Translation(""), * category = @Translation("General"), * data_types = { * "map", * }, * ) */
Either the description is added, or the
description
line is removed. As a side note, an empty string does not need to be translated, since an empty string is still an empty string in any language. - Status changed to Needs review
over 1 year ago 4:59pm 25 September 2023 - 🇺🇸United States apmsooner
Thanks @apaderno,
- I've removed description from all widget plugin annotations.
- I've made the feeds target exception message translatable.
- Status changed to RTBC
over 1 year ago 5:18pm 25 September 2023 - Status changed to Needs work
over 1 year ago 1:05pm 26 September 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
$message = $this->t($e->getMessage()); $this->messenger()->addError($message);
Passing a dynamic string is considered a security issue. The first parameter passed to
$this->t()
must be a literal string./src/Plugin/CustomField/FieldFormatter/DateTimeCustomFormatter.php
$elements['date_format'] = [ '#type' => 'textfield', '#title' => $this->t('Date/time format'), '#description' => $this->t('See <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters" target="_blank">the documentation for PHP date formats</a>.'), '#default_value' => $settings['date_format'], ];
Placeholders are used for URLs. This also avoids that translators gets a part they should not touch in the string to translate.
src/Plugin/CustomField/FieldFormatter/DateTimeDefaultFormatter.php
$options = []; foreach ($format_types as $type => $type_info) { $format = $this->dateFormatter->format($time->getTimestamp(), $type); $options[$type] = $type_info->label() . ' (' . $format . ')'; } $elements['format_type'] = [ '#type' => 'select', '#title' => $this->t('Date format'), '#description' => $this->t("Choose a format for displaying the date. Be sure to set a format appropriate for the field, i.e. omitting time for a field that only has a date."), '#options' => $options, '#default_value' => $settings['format_type'], ];
Option strings shown in the user interface must be translatable. It is fine for the translatable string to contain at least two placeholders, as translators are at least able to decide the order of the placeholders, which could change basing on the language.
/src/Plugin/CustomField/FieldFormatter/MailToFormatter.php
$build = [ '#type' => 'link', '#title' => $settings['value'], '#url' => Url::fromUri('mailto:' . $settings['value']), ]; $output = \Drupal::service('renderer')->render($build); return $output;
If dependencies are required, the class must implement
ContainerFactoryPluginInterface
./src/Plugin/CustomField/FieldType/EmailType.php
$constraints['Length'] = [ 'max' => self::EMAIL_MAX_LENGTH, 'maxMessage' => $this->t('%name: the email address can not be longer than @max characters.', [ '%name' => $settings['name'], '%max' => self::EMAIL_MAX_LENGTH, ]),
The placeholder used in the string is not the placeholder passed to
$this->t()
.src/Plugin/CustomField/FieldWidget/FloatWidget.php
/** * {@inheritdoc} */ public function massageFormValue(mixed $value): mixed { if (!is_numeric($value)) { return NULL; } return $value; }
I could have missed it, but I do not see any
massageFormValue()
method in the parent classes or the interfaces they implement.src/Plugin/CustomFieldTypeManager.php
foreach ($data_types as $key => $data_type) { $options[$key] = $this->t('@label', ['@label' => $data_type['label']]); }
That code does not return the translation of
$data_type['label']
. That code is equivalent to$options[$key] = $data_type['label'];
. Either$data_type['label']
is already translated and the call to$this->t()
is not necessary, or the translation of$data_type['label']
must be obtained in another way.src/CustomFieldUpdateManager.php
if (!$field_storage_definition) { $message = $this->t('There is no field storage definition for field @field_name and entity type @type.', [ '@field_name' => $field_name, '@type' => $entity_type_id, ]); throw new \Exception($message); }
Exception messages are not translatable strings.
'init_message' => $this->t('Starting data restoration for @count tables...', ['@count' => count($tables)]),
For that message
formatPlural()
must be used. - Status changed to Needs review
over 1 year ago 7:03pm 26 September 2023 - 🇺🇸United States apmsooner
@apaderno,
I've addressed all issues you've noted. FYI, one of the issues you noted was result of copy from Core's datetime formatter: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/datet.... I've fixed my implementation but similar issue you noted still exists in Core for the following:
$elements['date_format'] = [ '#type' => 'textfield', '#title' => $this->t('Date/time format'), '#description' => $this->t('See <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters" target="_blank">the documentation for PHP date formats</a>.'), '#default_value' => $settings['date_format'], ];
- Assigned to apaderno
- Status changed to RTBC
over 1 year ago 9:48am 27 September 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
$elements['date_format'] = [ '#type' => 'textfield', '#title' => $this->t('Date/time format'), '#description' => $this->t('See <a href="@url" target="_blank">the documentation for PHP date formats</a>.', [ '@url' => 'https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters', ]), '#default_value' => $settings['date_format'], ];
The correct placeholder for URLs is :url as described in
FormattableMarkup::placeholderFormat()
, which must be wrapped in quote characters. - 🇮🇹Italy apaderno Brescia, 🇮🇹
Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
- Dries → ' post on Responsible maintainers
- Best practices for creating and maintaining projects →
- Maintaining a drupal.org project with Git →
- Commit messages - providing history and credit →
- Release naming conventions → .
- Helping maintainers in the issue queues →
You can find more contributors chatting on the Slack → #contribute channel. So, come hang out and stay involved → .
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review → . I encourage you to learn more about that process and join the group of reviewers.I thank all the reviewers.
- Status changed to Fixed
over 1 year ago 9:50am 27 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.