Closed (fixed)
Project:
Slick Carousel
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2020 at 19:59 UTC
Updated:
28 Feb 2020 at 10:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
thallesFollow a new patch
Comment #3
gausarts commentedAwesome. Thanks!
You might want to move the basic setters (
::setFormatter(),::setManager(),::setImageFactory()) into https://git.drupalcode.org/project/slick/blob/8.x-2.x/src/Plugin/Field/F...This way the rest should be able to call them without redefining.
Then please replace the references to the following at other patches:
with below setters:
The
$instance->setFormatter(), $instance->setImageFactory()and few more similar setters can be removed later once Blazy has them.The same DRY should apply if you use setters for
$instance->imageFactory, $instance->blazyEntity, $instance->blazyOembed, I think. And later they can be removed, too. These are still/ only needed during transition, though.Alternatively create a new method to not repeat, but optimization can be ignored for now.
Feel free to commit it after this change to the rest. Thanks again!
Comment #4
gausarts commentedOh, please also consider
protectednotpublicvisibility for these setters.Comment #5
gausarts commentedOne more, please. You might want to return the instance for all setters like below:
For chainability like at most OO languages.
Comment #6
gausarts commentedI just tested your patches.
It turned out setters give more trouble given different situations, either before or after blazy provides them. Setters are only good in trickle down approach, not the reverse like during this transition.
Conclusion:
1. Abandon my idea about setters at #5. I will mark them deleted.
2. Stick to your approach. Yours is safer for now.
Later when all is settled, we can start implementing setters at blazy for most similar services, then at sub-classes for anything else.
Thanks!
Comment #7
gausarts commentedLet's see.
Comment #9
gausarts commentedLet's get the ball rolling, we have another release to catch up. Any (side) issue and or improvements may follow as always.
Committed. Thank you for contribution!
Comment #10
thallesThanks @gausarts!