Used dependency injection insted of using \Drupal::

Created on 25 July 2023, over 1 year ago

Problem/Motivation

src/Plugin/Field/FieldFormatter/AdvancedLinkAttributesFieldFormatter.php

Steps to reproduce

check this file src/Plugin/Field/FieldFormatter/AdvancedLinkAttributesFieldFormatter.php

Proposed resolution

Used dependency injection in this file.

📌 Task
Status

Needs work

Version

2.5

Component

Code

Created by

🇮🇳India Nishant

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

Comments & Activities

  • Issue created by @Nishant
  • @nishant opened merge request.
  • @nishant opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Nishant

    Provided MR, Please verify

  • 🇺🇸United States danflanagan8 St. Louis, US

    Even a basic attempt at testing this code would have shown that is fails catastrophically.

    The website encountered an unexpected error. Try again later.
    
    TypeError: Drupal\ala\Plugin\Field\FieldFormatter\AdvancedLinkAttributesFieldFormatter::_construct(): Argument #1 ($token) must be of type Drupal\Core\Utility\Token, string given, called in /app/docroot/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php on line 40 in Drupal\ala\Plugin\Field\FieldFormatter\AdvancedLinkAttributesFieldFormatter->_construct() (line 50 of modules/contrib/ala/src/Plugin/Field/FieldFormatter/AdvancedLinkAttributesFieldFormatter.php).

    The dev branch is currently unusable.

  • 🇺🇸United States danflanagan8 St. Louis, US

    I created 🐛 ALA field formatter causes WSOD Active

    I'm setting the status of this issue to Fixed since the MR has been committed. Let's focus on the new issue.

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

Production build 0.71.5 2024