- Issue created by @dcam
- πΊπΈUnited States dcam
For the record, adding the $typedConfigManager type hint resulted in this error in D10.4.1:
PHP Fatal error: Type of Drupal\usfedgov_google_analytics\Form\UsfedgovGoogleAnalyticsForm::$typedConfigManager must not be defined (as in class Drupal\Core\Form\ConfigFormBase) in /var/www/html/web/modules/contrib/usfedgov_google_analytics/src/Form/UsfedgovGoogleAnalyticsForm.php on line 15
I know there was an issue with how core implemented this new ConfigFormBase parameter. I'm not yet certain if this will cause an issue with supporting D10 and D11 with the same version.
- πΊπΈUnited States dcam
The settings form class's constructor could not support both D10 and D11 as it was written.
The pattern I've implemented instead is useful for isolating a class from upstream changes. You aren't trying to override the parent's constructor anymore, so if it changes then you don't have to care or do anything, at least not in the short term. The downside is that the code is uglier because you have to add more boilerplate in the form of property declarations and setter functions.
Automatically closed - issue fixed for 2 weeks with no activity.