Problem/Motivation

Follow-up from #2509722: "Error: missing help" in Views for Node fields without descriptions.

NodeViewsData has lots of t() calls, it could use $this->t() instead since EntityViewsData uses StringTranslationTrait.

Proposed resolution

Update NodeViewsData to use $this->t() instead of t().

Check other classes that extend EntityViewsData in core and make the same change if needed.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

catch created an issue. See original summary.

mohit_aghera’s picture

Status: Active » Needs review
StatusFileSize
new57.96 KB

Uploading basic patch with required change.

Status: Needs review » Needs work
mohit_aghera’s picture

By mistake used 8.0.x branch. Updating with latest patch with head from 8.1.x

mohit_aghera’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Perfect!

There is no example left:

$ag " t\(" | grep "ViewsData.php"

Additional I reviewed the changes using git diff --color-words and all changes looked perfect

catch’s picture

Status: Reviewed & tested by the community » Fixed

fwiw this removes 15% of the t() calls in core.

Committed/pushed to 8.1.x, thanks!

  • catch committed 55e3b42 on 8.1.x
    Issue #2667346 by mohit_aghera: EntityViewsData extending classes should...

Status: Fixed » Closed (fixed)

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