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: Blazy » Slick
Version: 8.x-2.x-dev »
thalles’s picture

Project: Slick » Slick Carousel
Version: » 8.x-2.x-dev
gausarts’s picture

Awesome!
Any chance you give it a whirl with SlickManager, and its field formatters, too? Much appreciated.

thalles’s picture

Yeah! But, can be in another issue?

thalles’s picture

Follow a patch

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

Status: Needs review » Fixed
gausarts’s picture

Thank you! One minor issue, though.

Looks like we now have few unused use statements. Feel free to push the fix directly upstream:

...slick/slick_ui/src/Form/SlickSettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement
 6 | WARNING | [x] Unused use statement

  • thalles committed 34acb14 on 8.x-2.x
    Issue #3112883 by thalles: Fix subclassing and stop overriding...

Status: Fixed » Closed (fixed)

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