localgovdrupal / localgov_events

Events for LocalGov Drupal.
GNU General Public License v2.0
1 stars 0 forks source link

Update drupal/date_recur to 3.2.0 to fix PHP 8.1 dependency issue #72

Closed budda closed 1 year ago

budda commented 2 years ago

Problem Events feature currently depends on "drupal/date_recur": "^3.0",

Which in turn depends on rlanvin/php-rrule v1

The fix is to use v2 of the php-rrule library.

Detailed in https://github.com/rlanvin/php-rrule/issues/102 and https://www.drupal.org/project/date_recur/issues/3267221

Fix Update composer.json to date_recur 3.2.0-beta2 released 27 November 2021

andybroomfield commented 2 years ago

Date Recur 3.2 requires php 8.1 and not everyone is able to use that yet. However I was able to install Date Recur 3.2 by adding it as a composer.json root requirement (It won't auto update as I assume its not stable release yet, it's beta 2).

stephen-cox commented 2 years ago

We're almost at a point were we can fully support PHP 8.1, see: https://github.com/localgovdrupal/localgov/issues/424

Date Recur 3.2 does install with PHP 8.1, but rlanvin/php-rule seems to be stuck on v1, which is the cause of failing tests (https://github.com/localgovdrupal/localgov/issues/437) as well as likely the cause of the error with the Demo module.

This should be fixed with PR #78

kiwimind commented 1 year ago

Having run composer updates today, it appears that this is still an issue. While the localgov_events composer.json does include the changes mentioned above to the version of rlanvin/php-rrule, the version of date_recur is still locked at ^3.0.

✗ composer depends rlanvin/php-rrule
drupal/date_recur               3.1.0   requires  rlanvin/php-rrule (1.*)
localgovdrupal/localgov_events  2.0.12  requires  rlanvin/php-rrule (^1.0|^2.0)

Is the reason we can't update the version of date_recur to 3.2 due to it only being supported on >= php8.1?

stephen-cox commented 1 year ago

This is an old issue as LocalGov Drupal now recommends PHP 8.1

@kiwimind What version of PHP are you using? The version of php-rrule installed should change depending on the version.

On PHP 8.1

composer show rlanvin/php-rrule shows version 2.4.0.

$ composer depends rlanvin/php-rrule
drupal/date_recur              3.2.0  requires rlanvin/php-rrule (^1 || ^2)  
localgovdrupal/localgov_events 2.0.12 requires rlanvin/php-rrule (^1.0|^2.0) 

On PHP 7.4

composer show rlanvin/php-rrule shows version 1.6.3

$ composer depends rlanvin/php-rrule
drupal/date_recur               3.1.0   requires  rlanvin/php-rrule (1.*)        
localgovdrupal/localgov_events  2.0.12  requires  rlanvin/php-rrule (^1.0|^2.0)
kiwimind commented 1 year ago

@stephen-cox thanks for your message.

Seems it was a throwback to an older version of PHP being specified in the composer's platform config.

All good now.

stephen-cox commented 1 year ago

Thanks for confirming @kiwimind