Problem/Motivation

Add object that uses the FactoryInterface should have dependencies inject via ::create and not ::__construct(). This allows parent classes to change their constructor without breaking any code.
@see https://events.drupal.org/seattle2019/sessions/drupal-9-coming-getting-y...

Example: \Drupal\config_sync\Controller\ConfigSyncController::create
@see https://www.youtube.com/watch?time_continue=1554&v=hN9KjaBvAUk
@see https://www.previousnext.com.au/blog/safely-extending-drupal-8-plugin-cl...

Proposed resolution

Fix subclassing and stop overriding constructors.

Comments

thalles created an issue. See original summary.

thalles’s picture

Project: Advanced CSS/JS Aggregation » Modal
Version: 8.x-4.x-dev » 8.x-3.x-dev
Status: Needs work » Needs review
Parent issue: #3107859: Fix subclassing and stop overriding constructors in advagg\Form\OperationsForm »
StatusFileSize
new1.17 KB

Folloe a patch

thalles’s picture

Version: 8.x-3.x-dev » 8.x-2.x-dev
thalles’s picture

  • thalles committed 0b62c00 on 8.x-2.x
    Issue #3108091 by thalles: Fix subclassing and stop overriding...
thalles’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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