Problem/Motivation

We have some classes that extend DevelGenerateBase from devel module.
(especially LanguageDevelGenerate)
These classes are currently not aligned with the base class, causing tests to error out.

Also, LanguageDevelGenerate currently gets an entity storage in the constructor.
This is generally considered bad practice, it is better to simply store entity type manager as a property and then get a storage when it is needed, to avoid unnecessary computation in the constructor.

Steps to reproduce

Proposed resolution

Require (dev) drupal/devel.
Align classes with the base class DevelGenerateBase so they don't break Liskov.
Remove the entity storage property LanguageDevelGenerate->languageStorage. Retrieve the storage when it is needed. (as consequence we no longer need to override the parent __construct() and ::create().)

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

donquixote created an issue. See original summary.

donquixote’s picture

Status: Active » Needs review

fmb made their first commit to this issue’s fork.

  • fmb committed a83ddcb3 on 3.0.x authored by donquixote
    Issue #3553113: Don't get entity storage in constructor, in classes...

  • fmb committed ee001164 on 3.0.x authored by donquixote
    Issue #3553113: Align with parent class DevelGenerateBase.
    

fmb’s picture

Status: Needs review » Fixed

Align classes with the base class DevelGenerateBase so they don't break Liskov.

Well, that would be better than breaking half of the Internet, right? Sorry, actually AWS and DNS are already taking care of this.

Anyway, thanks for your work on these issues!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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