Skip to content
Snippets Groups Projects

Fix 'Drupal.Semantics.FunctionT.NotLiteralString' coding standard

Closes #3123067

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 78 78 $query->fields('pf', ['name', 'title']);
    79 79 $results = $query->execute();
    80 80 foreach ($results as $profile) {
    81 // phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
    81 82 $fields[$profile['name']] = $this->t($profile['title']);
    82 83 }
  • 206 206 protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {
    207 207 try {
    208 208 Database::getConnection()->query($query);
    209 // phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
    209 210 $this->pass(t($pass));
    210 211 }
    211 212 catch (\Exception $e) {
    213 // phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
    212 214 $this->fail(t($fail, ['%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name()]));
    • Comment on lines 208 to 212

      I guess this is because we do not know the argument values when create the strings in \Drupal\Core\Database\Install\Tasks::

      There was an error rendering this math block. KaTeX parse error: Undefined control sequence: \Drupal at position 137: …the strings in \̲D̲r̲u̲p̲a̲l̲\Core\Database\…
      tasks have ever been translated. It's not in German or Ukrainian - the top two translations on localize.drupal.org

      I kinda feel we need a file that POTX can parse for strings that we know POTX will never extract.

    • Author Maintainer

      Does 'kinda feel' mean this needs a followup?

    • Please register or sign in to reply
  • Author Maintainer

    Made a few of the followups. There is still more to do.

  • quietone added 31 commits

    added 31 commits

    Compare with previous version

  • Author Maintainer

    I think that is all of the followups.

  • quietone added 195 commits

    added 195 commits

    Compare with previous version

  • catch @catch started a thread on the diff
  • 74 74 );
    75 75
    76 76 // Pass the original string to the t() function to get it marked as safe.
    77 // phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
    77 78 $safe_string = t($original_string);
  • assigned to @quietone

  • unassigned @quietone

  • Author Maintainer

    Resolved all the threads where followups were asked for and created.

  • quietone added 196 commits

    added 196 commits

    Compare with previous version

  • quietone added 219 commits

    added 219 commits

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading