I found the issue: I further investigated, with xdebug and I got a bit more specific error:
ParseError: syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/html/vendor/palantirnet/drupal-rector/src/Services/AddCommentService.php on line 16
That class uses typed properties, that cannot work with PHP 7.3 but only with PHP 7.4+
I don't know why composer allowed me to install the package without complaining (maybe it doesn't have the correct php requirement set in the composer.json?) anyway now it seems to work properly!
FrancescoQ → created an issue.
I found some issues with the first provided approach:
- - only one provider could be set, as the last one overrides the previous ones.
- - there could be some issues in case of different js loading times, when the provider js file was loaded before the library.
with the attached patch I changed the way we provide/collect the cacheable cookie handling providers, by treating more in a similar way Drupal core use the behaviours:
- - They are now stored in "their own" Drupal property
cacheableCookieHandlingProviders
so there's no risk thatcacheableCookieHandling
in not initialised if the JS are loaded in different order. - - When
cacheableCookieHandling
init we search/loop that property and if we found some providers we use the provided data - - Before this change the last provider set in the
cacheableCookieHandling
object was the only one that could provide data since it overrides the old ones (we don't have a case of multiple providers yet, but this could happens), now all the providers are manteined.
I also provided an updated example with this new logic implemented.