Problem/Motivation

In my current project we are using PHP8.0 and when I tried to install this module I got this error:

  Problem 1
    - Root composer.json requires drupal/rocket_chat == 2.5.0.0 -> satisfiable by drupal/rocket_chat[2.5.0].
    - drupal/rocket_chat 2.5.0 requires php ^7.2 -> your php version (8.0.13) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires drupal/rocket_chat_api == 2.5.0.0 -> satisfiable by drupal/rocket_chat_api[2.5.0].
    - drupal/rocket_chat_api 2.5.0 requires php ^7.2 -> your php version (8.0.13) does not satisfy that requirement.

Proposed resolution

Using this package: PHPCompatibility/PHPCompatibility I ran the following command:

phpcs -p . --standard=PHPCompatibility
........................... 27 / 27 (100%)

Time: 408ms; Memory: 12MB

And it seems that this module is already compatible with PHP8, the only thing missing is let Composer know about this.

Remaining tasks

Update this:

"require": {
       "ext-json": "*",
       "php": "^7.2",
       "drupal/core": "^8.8 || ^9"
    },

To this:

"require": {
       "ext-json": "*",
       "php": "^7.2||^8",
       "drupal/core": "^8.8 || ^9"
    },

(Patch in my next comment.)

CommentFileSizeAuthor
#7 rocket_chat-3254242-6.patch14.42 KBvladimiraus
#2 3254242-2.patch325 bytesgnuget
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gnuget created an issue. See original summary.

gnuget’s picture

StatusFileSize
new325 bytes

Patch attached.

gnuget’s picture

Issue summary: View changes
Status: Active » Needs review
heliogabal’s picture

Version: 8.x-2.x-dev » 8.x-2.5
Status: Needs review » Reviewed & tested by the community

thanks for the patch! I successfully applied the patch and could install the module afterwards, PHP 8.0.13 as well. Setting to RTBC because it's a trivial change that unblocks installation on Drupal 9. Would be helpful to be committed soon, so this module can be installed with composer again.

josh.chambers’s picture

I concur it would be nice to have this update pushed so I can update using composer without having to use ignore-platform-req

vladimiraus’s picture

Status: Reviewed & tested by the community » Needs review

Updated requirements and coding standards.
Also check out #3298815: Offering to maintain Rocket.Chat.

vladimiraus’s picture

StatusFileSize
new14.42 KB
vladimiraus’s picture

Version: 8.x-2.5 » 8.x-2.x-dev
sysosmaster’s picture

Assigned: Unassigned » sysosmaster
Priority: Normal » Major

Bumped Prio to reflect how out of date this code is & desire to use proper PHP.

I'll need to find some time to do a fresh test setup (I lost my previous test rig).

mortona2k made their first commit to this issue’s fork.

mortona2k’s picture

It says the patch did not apply, so I created an issue fork and was able to apply the patch.

  • sysosmaster committed be94899 on 8.x-2.x authored by mortona2k
    Issue #3254242: PHP8 Support
    feat: Bumped Drupal version to minimal 9.4...
sysosmaster’s picture

Assigned: sysosmaster » Unassigned
Status: Needs review » Fixed
pandepoulus’s picture

All submodules should also be compatible with php 8.
as composer why-not php:8.1
drupal/rocket_chat_api 3.0.0 requires php (^7.2)

vladimiraus’s picture

  • sysosmaster committed 85d76d8 on 3.0.x
    Issue #3254242 by sysosmaster, Pandepoulus: PHP8 Support
    Thanks to...
sysosmaster’s picture

@VladimirAus what is missing for Drupal 10 compatibility?
Cause I don't get why you added that tag...

pandepoulus’s picture

I think it works, but rocket_chat_api.info.yml has this line:
dependencies:
php: 7.4

and composer.json inside rocket_chat_api has this require:

    "require": {
        "guzzlehttp/guzzle": "^6.2",
        "php" : "^7.2",
        "drupal/core": "^8.8 || ^9"
    }

Kind regards.

sysosmaster’s picture

@Pandepoulus have you tried version 3.0.1 that should have fixed it.

pandepoulus’s picture

Sorry i didn't see it yesterday.
Many thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.