- 🇩🇪Germany simonbaese Berlin
I saw your thread on reddit and took a quick look at this issue. The problem is that the plugin
GoogleAnalyticsCounterQueueBase
is not "constructed" correctly. It extends theQueueWorkerBase
, but also overwrites the constructor (without calling the parent constructor) and create methods. In the comment, it said that dependency injection is not required, although services are used in the plugin and theContainerFactoryPluginInterface
is also used. This should be reworked in another issue.For now I can only provide a simple patch, because I am traveling. Also, I was not able to do extensive testing, so please let me know if it works.
- 🇮🇳India sandipta
Sure. I will test it out and will let you know. Thanks for the help 🙂
- last update
about 1 year ago 8 pass - last update
about 1 year ago 8 pass - 🇮🇳India Vivek Panicker Kolkata
Nice spot there @simonbaese.
I got inspiration from your idea to create this patch.
@sandipta please review this patch since it is not tested and see if it helps resolve your issue.
- last update
about 1 year ago 8 pass - 🇮🇳India sandipta
Definitely, I'll test it out and will let you know. Thanks for the patch. @Vivek Panicker
- 🇩🇪Germany simonbaese Berlin
@Vivek Panicker The
__construct()
andcreate()
call inGoogleAnalyticsCounterQueueBase
is not necessary since it extends theQueueWorkerBase
which extends thePluginBase
.The
PluginBase
constructor does everything needed to instantiate the plugin for the moment.Since no dependency injection is used at the moment the `create()` method required by the
ContainerFactoryPluginInterface
is not necessary (should change in the context of another issue as mentioned above). -
kaszarobert →
committed bbf56157 on 4.0.x authored by
simonbaese →
Issue #3387501 by simonbaese, Vivek Panicker, sandipta: Google Analytics...
-
kaszarobert →
committed bbf56157 on 4.0.x authored by
simonbaese →
- Status changed to Fixed
about 1 year ago 7:44pm 18 September 2023 - 🇸🇰Slovakia kaszarobert
I committed patch #3. Thanks for reporting and finding out this problem.
I was developing branch 4.0.x on a Drupal 9 site and never tried it on Drupal 10. On Drupal 9 everything works fine and since I don't use deprecated Drupal API calls, then I expected that it should work on D10, too. It seems I was terribly wrong. Something about plugins are not the same in D10. TBH, I don't know why was this strange empty constructor there in the first place, this is leftover code from an older release by previous maintainers that I missed to review when working with it. Anyway, please check out the newest release, it should work now.
- 🇮🇳India Vivek Panicker Kolkata
Thanks for the explanation @simonbaese.
@kaszarobert I think we should have an issue then to properly apply depdendency injection in the class files.
- 🇸🇰Slovakia kaszarobert
Alright, I opened 🐛 Avoid static \Drupal calls inside class methods and use proper DI Active .
Automatically closed - issue fixed for 2 weeks with no activity.