Unable to require h5p on D10

Created on 3 August 2023, over 1 year ago
Updated 16 November 2023, 12 months ago

Problem/Motivation

Steps to reproduce

 "require": {
        "php": "^8.0",
        "composer/installers": "^1.9",
        "drupal/core-recommended": "^10",
        "symfony/polyfill-mbstring": "^1.27.0",
        "drush/drush": "^11 || ^12",
        "drupal/h5p": "^2.0.0-alpha3"
            "drupal/h5p": {
                "d10": "https://www.drupal.org/files/issues/2023-07-31/drupal.org_files_issues_2023-07-28_drupal.org_files_issues_2023-04-25_h5p-3329297_aggregation_css_fixed.patch"
            },
   "require-dev": {
        "cweagans/composer-patches": "^1.7",
        "symplify/vendor-patches": "^11.0",
        "phpspec/prophecy-phpunit": "^2",
        "weitzman/drupal-test-traits": "^1.6",
        "drupal/core-dev": "^10"
    },

Output error in composer install command

composer update -W
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - zendframework/zend-feed[dev-master, dev-develop, 2.11.0, ..., 2.13.x-dev] require php ^5.6 || ^7.0 -> your php version (8.1.0) does not satisfy that requirement.
    - laminas/laminas-feed[2.12.0, ..., 2.12.x-dev] require php ^5.6 || ^7.0 -> your php version (8.1.0) does not satisfy that requirement.
    - symfony/psr-http-message-bridge[v1.1.0, ..., 1.1.x-dev] require php ^5.3.3 || ^7.0 -> your php version (8.1.0) does not satisfy that requirement.
    - symfony-cmf/routing[1.4.0-RC1, ..., 1.4.x-dev] require php ^5.3.9|^7.0 -> your php version (8.1.0) does not satisfy that requirement.
    - symfony/psr-http-message-bridge[v1.2.0, ..., v1.3.0] require php ^7.1 -> your php version (8.1.0) does not satisfy that requirement.
    - drupal/core[8.9.11, ..., 8.9.x-dev] require php ^7.0.8 -> your php version (8.1.0) does not satisfy that requirement.
    - drupal/core[9.0.10, ..., 9.0.x-dev] require php ^7.3 -> your php version (8.1.0) does not satisfy that requirement.
    - drupal/core 8.0.0-beta6 requires doctrine/common dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5 -> found doctrine/common[dev-remove-int-cast, dev-deprec-proxy, 2.1.3, ..., 2.13.x-dev, 3.0.0, ..., 3.5.x-dev] but it does not match the constraint.
    - drupal/core[8.0.0-beta13, ..., 8.0.0-beta15] require guzzlehttp/guzzle dev-master#1879fbe853b0c64d109e369c7aeff09849e62d1e -> found guzzlehttp/guzzle[v1.0.3, v1.0.4, v2.0.0, ..., v2.8.8, v3.0.0, ..., v3.8.1, 4.0.0-rc.1, ..., 4.x-dev, 5.0.0, ..., 5.3.x-dev, 6.0.0, ..., 6.5.x-dev, 7.0.0-beta.1, ..., 7.7.x-dev] but it does not match the constraint.
    - drupal/core-recommended[10.0.0-alpha1, ..., 10.0.0-alpha2] require symfony/polyfill-mbstring v1.24.0 -> found symfony/polyfill-mbstring[v1.24.0] but it conflicts with your root composer.json require (^1.27.0).
    - laminas/laminas-feed[2.13.0, ..., 2.14.x-dev] require php ^7.3 || ~8.0.0 -> your php version (8.1.0) does not satisfy that requirement.
    - drupal/core-recommended[10.0.0-alpha3, ..., 10.0.0-alpha5] require symfony/polyfill-mbstring v1.25.0 -> found symfony/polyfill-mbstring[v1.25.0] but it conflicts with your root composer.json require (^1.27.0).
    - drupal/core-recommended[10.0.0-alpha6, ..., 10.0.0-rc1] require symfony/polyfill-mbstring ~v1.26.0 -> found symfony/polyfill-mbstring[v1.26.0] but it conflicts with your root composer.json require (^1.27.0).
    - Root composer.json requires drupal/h5p ^2.0.0-alpha3 -> satisfiable by drupal/h5p[2.0.0-alpha3].
    - drupal/core-recommended 10.1.0-alpha1 requires drupal/core 10.1.0-alpha1 -> satisfiable by drupal/core[10.1.0-alpha1].
    - Conclusion: don't install drupal/core 10.1.0-alpha1 (conflict analysis result)
    - drupal/core-recommended 10.1.0-beta1 requires drupal/core 10.1.0-beta1 -> satisfiable by drupal/core[10.1.0-beta1].
    - Conclusion: don't install drupal/core 10.1.0-beta1 (conflict analysis result)
    - drupal/core-recommended 10.0.0-rc2 requires drupal/core 10.0.0-rc2 -> satisfiable by drupal/core[10.0.0-rc2].
    - Conclusion: don't install drupal/core 10.0.0-rc2 (conflict analysis result)
    - drupal/core-recommended 10.0.0-rc3 requires drupal/core 10.0.0-rc3 -> satisfiable by drupal/core[10.0.0-rc3].
    - Conclusion: don't install drupal/core 10.0.0-rc3 (conflict analysis result)
    - drupal/core-recommended 10.1.0-rc1 requires drupal/core 10.1.0-rc1 -> satisfiable by drupal/core[10.1.0-rc1].
    - Conclusion: don't install drupal/core 10.1.0-rc1 (conflict analysis result)
    - drupal/core-recommended 10.0.0 requires drupal/core 10.0.0 -> satisfiable by drupal/core[10.0.0].
    - Conclusion: don't install drupal/core 10.0.0 (conflict analysis result)
    - drupal/core-recommended 10.0.1 requires drupal/core 10.0.1 -> satisfiable by drupal/core[10.0.1].
    - Conclusion: don't install drupal/core 10.0.1 (conflict analysis result)
    - drupal/core-recommended 10.0.2 requires drupal/core 10.0.2 -> satisfiable by drupal/core[10.0.2].
    - Conclusion: don't install drupal/core 10.0.2 (conflict analysis result)
    - drupal/core-recommended 10.0.3 requires drupal/core 10.0.3 -> satisfiable by drupal/core[10.0.3].
    - Conclusion: don't install drupal/core 10.0.3 (conflict analysis result)
    - drupal/core-recommended 10.0.4 requires drupal/core 10.0.4 -> satisfiable by drupal/core[10.0.4].
    - Conclusion: don't install drupal/core 10.0.4 (conflict analysis result)
    - drupal/core-recommended 10.0.5 requires drupal/core 10.0.5 -> satisfiable by drupal/core[10.0.5].
    - Conclusion: don't install drupal/core 10.0.5 (conflict analysis result)
    - drupal/core-recommended 10.0.6 requires drupal/core 10.0.6 -> satisfiable by drupal/core[10.0.6].
    - Conclusion: don't install drupal/core 10.0.6 (conflict analysis result)
    - drupal/core-recommended 10.0.7 requires drupal/core 10.0.7 -> satisfiable by drupal/core[10.0.7].
    - Conclusion: don't install drupal/core 10.0.7 (conflict analysis result)
    - drupal/core-recommended 10.0.8 requires drupal/core 10.0.8 -> satisfiable by drupal/core[10.0.8].
    - Conclusion: don't install drupal/core 10.0.8 (conflict analysis result)
    - drupal/core-recommended 10.0.9 requires drupal/core 10.0.9 -> satisfiable by drupal/core[10.0.9].
    - Conclusion: don't install drupal/core 10.0.9 (conflict analysis result)
    - drupal/core-recommended 10.0.10 requires drupal/core 10.0.10 -> satisfiable by drupal/core[10.0.10].
    - Conclusion: don't install drupal/core 10.0.10 (conflict analysis result)
    - drupal/core-recommended 10.1.0 requires drupal/core 10.1.0 -> satisfiable by drupal/core[10.1.0].
    - Conclusion: don't install drupal/core 10.1.0 (conflict analysis result)
    - drupal/core-recommended 10.1.1 requires drupal/core 10.1.1 -> satisfiable by drupal/core[10.1.1].
    - Conclusion: don't install drupal/core 10.1.1 (conflict analysis result)
    - drupal/core-recommended 10.1.2 requires drupal/core 10.1.2 -> satisfiable by drupal/core[10.1.2].
    - Conclusion: don't install drupal/core 10.1.2 (conflict analysis result)
    - drupal/core[8.4.0-alpha1, ..., 8.7.7] require symfony-cmf/routing ^1.4 -> satisfiable by symfony-cmf/routing[1.4.0-RC1, ..., 1.4.x-dev].
    - drupal/core[8.2.0-beta1, ..., 8.3.x-dev] require symfony-cmf/routing ~1.4 -> satisfiable by symfony-cmf/routing[1.4.0-RC1, ..., 1.4.x-dev].
    - drupal/core[9.0.0-alpha1, ..., 9.0.0-alpha2] require symfony/psr-http-message-bridge ^1.2.0 -> satisfiable by symfony/psr-http-message-bridge[v1.2.0, v1.3.0].
    - drupal/core[8.7.8, ..., 8.9.10] require symfony/psr-http-message-bridge ^1.1.2 -> satisfiable by symfony/psr-http-message-bridge[v1.1.2, 1.1.x-dev, v1.2.0, v1.3.0].
    - drupal/core[8.8.0-alpha1, ..., 8.8.x-dev] require zendframework/zend-feed ^2.12 -> satisfiable by laminas/laminas-feed[2.12.0, ..., 2.22.x-dev], zendframework/zend-feed[2.12.0, 2.12.x-dev, 2.13.x-dev].
    - drupal/core-recommended 10.1.x-dev requires drupal/core 10.1.x-dev -> satisfiable by drupal/core[10.1.x-dev].
    - Conclusion: don't install drupal/core 10.1.x-dev (conflict analysis result)
    - drupal/h5p 2.0.0-alpha3 requires drupal/core ^8 || ^9 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta12, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.1.2, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.1.8, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.7.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - drupal/core-recommended 10.0.x-dev requires drupal/core 10.0.x-dev -> satisfiable by drupal/core[10.0.x-dev].
    - Root composer.json requires drupal/core-recommended ^10 -> satisfiable by drupal/core-recommended[10.0.0-alpha1, ..., 10.1.x-dev].
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States jakegibs617

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jakegibs617
  • 🇳🇱Netherlands koosvdkolk

    This is how my colleague got it to work in D10 (so without Composer):

    1. You download https://www.drupal.org/project/h5p/releases/2.0.0-alpha3 and put is somewhere into web/modues manually
    2. You add "h5p/h5p-core": "1.24.4" "h5p/h5p-editor": "1.24.4" via composer
    3. You apply patch https://www.drupal.org/files/issues/2023-06-27/drupal.org_files_issues_2...
    4. Go to web/modules/.../h5p/src/H5PDrupal/H5PDrupal.php:241 and replace
      $cachedAsset = $optimizer->optimize($assets);

      with this

      $cachedAsset = $optimizer->optimize($assets, []);

    5. You install h5p and h5peditor modules
    6. Add an h5p reference field to any content type
    7. Select h5p editor widget (it will support both editing and uploading this way)
    8. It'll still throw warnings on uploads and deprecation errors
  • 🇺🇦Ukraine solariel

    Unfortunately, this is tied to how drupal.org automatically injects composer requirements by checking the .info.yml of the module. Until maintainers update the info file noone will be able to do anything. For now the only way to install h5p on D10 is manually with applying patches from https://www.drupal.org/project/h5p/issues/3329297 📌 Automated Drupal 10 compatibility fixes Needs review

  • 🇺🇸United States jakegibs617

    oof. Yeah, I was able to bypass this so far by downloading the files directly and tracking them... But obviously, this is a pain and breaks how I build my Drupal app. Generally, I leverage the composer install command when building, but until they release an updated version it seems I am stuck with bad practices

  • 🇨🇦Canada ryanrobinson_wlu

    +1

    Our "go / no go" date for a Drupal 10 update is Aug 18th. If H5P doesn't have a Drupal 10 release by then, we won't be able to update as hoped before the new school year brings in a lot more traffic. Everything else is lined up.

    I'd love to at least hear from the maintainers if this is likely to happen or not so we can plan accordingly.

  • 🇨🇦Canada ryanrobinson_wlu

    Does this project have a maintainer? We missed our last hopeful update date, but have one more opportunity coming up in early October before the Drupal 9 end of life. It would be wonderful if there was a version with Drupal 10 support by then, incorporating a lot of the patches that have been provided. Even if there are some edge case bugs, that would probably be better than being stuck on Drupal 9 past the EOL.

  • 🇺🇸United States pdxclankeith

    For modules that need a patch to make core_version_requirement include ^10, you need to install the composer lenient endpoint fix. Dependencies are checked before patches are applied, so the H5P module will not pass the Drupal core version requirement check until the patch marking it as D10 compatible is merged into the module. Using the composer lenient endpoint fix tells composer to ignore the core version requirement and allows the module to be included and then patched.

    Information on this can be found here: https://www.drupal.org/docs/develop/using-composer/using-drupals-lenient...

    To allow the H5P module to be installed with composer on Drupal 10, you need to require "mglaman/composer-drupal-lenient": "^1.0"
    and then add:

                    "drupal-lenient": {
                            "allowed-list": ["drupal/h5p"]
                    }
    

    in the "extra" section of the composer file.

  • 🇨🇦Canada ryanrobinson_wlu

    Thank you @pdxclankeith! This is a very helpful tool that I was not aware of.

    I was starting to fork the H5P module into my own repository and have my composer pull from that instead, but this is much better. It will be easier to switch back to the official repository if/when there is a proper release, and it is easier to keep track of which patches are applied.

  • 🇺🇸United States pdxclankeith

    @ryanrobinson_wlu glad it helped. I've recently found that very useful on a number of Drupal 10 upgrades I've been doing.

  • Status changed to Fixed about 1 year ago
  • 🇨🇦Canada shaundychko

    The latest 2.0.x dev release supports Drupal 10.

  • ShaunDychko at College Physics commented 4 days ago
    "The latest 2.0.x dev release supports Drupal 10."
    It does not work for me!
    Local Drupal site on Windows 11 - PHP 8.1.13 - Database Version 8.0.27 MySQL- Firefox browser - Drupal version 10.1.6 - H5P version 2.0.x-dev.
    I have installed H5P version 2.0.x-dev (manually); in Structure/Content Types I have created a new H5P content as usual. I can create a new H5P content and save it, but... only the page title is displayed (and the label of my H5P Drupal content under that title) , NOT the H5P content itself! No errors in the browser console.
    Any ideas?

  • 🇫🇮Finland anaconda777

    I have exactly same problem as #13 with Drupal 10.1.6 and in composer "drupal/h5p": "2.0.x-dev@dev",
    The editing works, but displaying any H5P content shows just empty page with title.

  • I'm pleased to report that h5p 2.0.0-alpha4 works! Just downloaded and installed on my local installation of Drupal 10... works as expected.
    Now looking forward to a definitive 2.0.0 version.

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

Production build 0.71.5 2024