Following is the deprecation errors other than covered by rector.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\h5p.install 259 Call to deprecated function file_delete(). Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\h5p.install 844 Call to deprecated function db_field_exists(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\h5p.install 845 Call to deprecated function db_add_field(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\h5p.install 850 Call to deprecated function db_field_exists(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\h5p.install 851 Call to deprecated function db_add_field(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\src\H5PDrupal\H5PDrupal.php 371 Call to deprecated function drupal_get_messages(). Deprecated in drupal:8.5.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\src\H5PDrupal\H5PDrupal.php 759 Call to deprecated function db_driver(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\src\H5PDrupal\H5PDrupal.php 769 Call to deprecated function db_driver(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
modules/contrib/h5p/h5p.info.yml 0 Add core_version_requirement: ^8 || ^9 to modules/contrib/h5p/h5p.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.
modules/contrib/h5p/modules/h5peditor/h5peditor.info.yml 0 Add core_version_requirement: ^8 || ^9 to modules/contrib/h5p/modules/h5peditor/h5peditor.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.
D:\Xampp\htdocs\drupal-8.8.5\modules\contrib\h5p\src\H5PDrupal\H5PDrupal.php 266 Call to deprecated function system_get_info(). Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
Comment | File | Size | Author |
---|---|---|---|
#27 | 3150110-drupal9_deprecated_report-27.patch | 48.83 KB | kuhikar |
#22 | fixed.patch | 43.81 KB | pjotr.savitski |
#7 | 3150110-drupal9_deprecated_report-7.patch | 43.81 KB | kolesnikoff |
#6 | 3150110-drupal9_deprecated_report-6.patch | 46.07 KB | kolesnikoff |
#5 | 3150110-drupal9_deprecated_report-5.patch | 46.05 KB | kolesnikoff |
Issue fork h5p-3150110
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:
- 3150110-drupal-9-readyness changes, plain diff MR !1
Comments
Comment #2
meet_bhanvadia CreditAttribution: meet_bhanvadia commentedComment #3
meet_bhanvadia CreditAttribution: meet_bhanvadia at TATA Consultancy Services commentedHi All,
This patch will solve all the deprecated issue related to drupal 9 compatibility for module.
Please review
Comment #4
meet_bhanvadia CreditAttribution: meet_bhanvadia at TATA Consultancy Services commentedComment #5
kolesnikoff CreditAttribution: kolesnikoff commentedFixed the fatal error introduced into #3. Tested and cleaned up Drupal Rector notices.
Please review and test.
Comment #6
kolesnikoff CreditAttribution: kolesnikoff commentedFixed typo in 'extension.list.module' service name.
Comment #7
kolesnikoff CreditAttribution: kolesnikoff commentedRe-rolled patch to apply properly.
Comment #8
heddnA pure code review, the changes included make sense in #7. Still need to get a D9 site running with this and do some manual regression testing. But a big +1 vote of confidence.
Comment #9
rudraksh_98 CreditAttribution: rudraksh_98 at TATA Consultancy Services for Pfizer, Inc. commentedPatch #7 working fine for me
tested it on D8 & D9.
Comment #10
ravimalviya2000 CreditAttribution: ravimalviya2000 as a volunteer and commentedI have review and tested for patch #7.Working fine for me.
Comment #11
bob.hinrichs CreditAttribution: bob.hinrichs commentedGreat to see this is happening. What is the timeline to merging to get a D9 compatibility for the composer package? This module is holding us back.
Comment #12
pjotr.savitski CreditAttribution: pjotr.savitski commentedDrupal-check gave one more deprecation when using version 9.1.4
Comment #15
geufroi CreditAttribution: geufroi commentedhello there,
I would like to install H5P on a 9.14 drupal version
I hace seen the different patches but I don't know how to apply them, if in first place composer doesn't allow to install the module.
here is the message i get from composer
Problem 1
- drupal/h5p[1.0.0-rc1, ..., 1.0.0-rc17] require drupal/core ^8 -> found drupal/core[8.0.0, ..., 8.9.13] but the package is fixed to 9.1.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires drupal/h5p ^1.0@RC -> satisfiable by drupal/h5p[1.0.0-rc1, ..., 1.0.0-rc17].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
can please suggest what to do ? thanks very much for your support ;-)
Comment #16
pjotr.savitski CreditAttribution: pjotr.savitski commented@geufroi This is not all that complicated, but is a bit messy.
I've found two different ways to accomplish that when I was checking out patch number seven:
git init; git add --all; git commit -m "Added all h5p package content"
command. Once that is done, you can then apply the patch you want by runinggit apply THE_PATH_YOU_WANT
Both solutions have their own issues. The second one requires more effort and could be considered messier.
This is how I have managed to get the solution number two working.
Change repositories part of
composer.json
file to include a special repository that will override H5P.Please note that I have defined a version 1.0 instead of RC17 to make sure that my override is used. You might probably be able to get it running with defining it as development release with something like RC17-D9 as a version. I have not tried, but that would be a more reasonable approach.
I have used the Git repository described in approach number one with just loading the current release package, initialising new repository, committing all the files and applying the patch. You could fork the repository on GitLab or anywhere else and use one the branch you want.
Last step was to require the H5P override version.
Not sure if I used the
composer require
for that or just added it directly into the corresponding file.The end result should be a working Drupal 9 instance with patched H5P module.
Please note that botch approaches require you to manually apply the patch and make the module compatible with Drupal 9 before doing anything. Each new release would require manual labor to repeat the process. NB! Do not define any meaningful versions that could be later on released by the module authors. Drupal does not care too much about that, but that will surely create confusion on composer side and require a lot of messing around and fixing things.
As for the best solution, then it would be for the module authors to accept the patched code and release a new version. We've made an effort to contact them, but there have not been any response so far. I've checked all the code from the patch number 7 and did not see anything unusual or problematic. Some testing with local instance and already existing materials did not produce any issues apart from a few deprecation warnings that are located in the code of dependencies and are easily fixable by applying a patch.
Hope that solves your issue and have fun.
Comment #17
geufroi CreditAttribution: geufroi commentedwhaoo ! This is a very long post you did and I am very grateful for your time and energy. I will give a try for sure.
cheers !
Comment #18
Daniel KulbeYour composer.json should look like this, if you want to use this issue branch:
Comment #19
MrPaulDriver CreditAttribution: MrPaulDriver commentedWill this recipe also work for 8.9?
Comment #20
jukka792 CreditAttribution: jukka792 as a volunteer commentedI modified the composer.json according to #18
The module was installed and works fine, but when running "drush cr", it shows this error:
PHP Fatal error: Cannot use Drupal\Core\File\FileSystemInterface as FileSystemInterface because the name is already in use in /var/www/html/sitename/web/modules/contrib/h5p/src/Form/H5PAdminSettingsForm.php on line 11
D 9.1.6
Comment #21
pjotr.savitski CreditAttribution: pjotr.savitski commented@jukka792 I was unable to reproduce that, though I've used a branch from this issue instead https://www.drupal.org/project/h5p/issues/3210822
That one is based on h5p-rc18 that will work with php version 7.4. The difference in code should not be very substantial.
@MrPaulDriver I'm not an expert in things, though 8.9 should be quite close to 9.x, at least with all the used APIs being available. If you were asking if the patched code would work with version 8.9.x, then the answer should be - yes, it will. The API calls that needed to be replaced were deprecated a long time ago with a few minor versions being released in the meantime.
Comment #22
pjotr.savitski CreditAttribution: pjotr.savitski commentedThe patch did not apply for some reason due to an issue with h5peditor.info.yml file.
It seems that applying the same change would have line 326 as
@@ -3,5 +3,6 @@
instead of@@ -3,6 +3,7 @@
.At least that was the output of making that change manually and making a patch.
Fixed that small issue and re-uploaded the patch file. All of the changes are still the same as with patch #7.
Comment #23
Anaconda777 CreditAttribution: Anaconda777 as a volunteer commentedHi,
Trying to upgrade D8.9.15 to D9.1.8
Composer update shows this:
- Can only install one of: drupal/core[9.1.x-dev, 8.9.15].
- drupal/core-recommended 9.1.x-dev requires drupal/core 9.1.x-dev -> satisfiable by drupal/core[9.1.x-dev].
- Installation request for drupal/core-recommended ^9.1.8 -> satisfiable by drupal/core-recommended[9.1.8, 9.1.x-dev, 9.2.0-alpha1, 9.2.x-dev, 9.3.x-dev].
- Installation request for drupal/h5p ^1.0@RC -> satisfiable by drupal/h5p[1.0.0-rc1, 1.0.0-rc2, 1.0.0-rc3, 1.0.0-rc4, 1.0.0-rc5, 1.0.0-rc6, 1.0.0-rc7, 1.0.0-rc8, 1.0.0-rc9, 1.0.0-rc10, 1.0.0-rc11, 1.0.0-rc12, 1.0.0-rc13, 1.0.0-rc14, 1.0.0-rc15, 1.0.0-rc16, 1.0.0-rc17, 1.0.0-rc18].
What could be the problem ? In my composer I have:
"drupal/core-recommended": "^9.1.8",
"drupal/h5p": "^1.0@RC"
Comment #24
pjotr.savitski CreditAttribution: pjotr.savitski commented@Anaconda777 Current H5P release will not work with Drupal version 9. Please see comment #18 for instructions on how to achieve what you might want. The only way I've found is to just have a repository with patch applied and use that as a source for drupal/h5p module. This was it is sure that there are no surprises in future and repository could be updated at any time.
If you want to try it locally, then this issue has a pull request branch that could be used in conjunction with configuration from commit #18 to get the 8.x-1.0-rc18 with the patch from comment #7 applied.
I went the own repository way due to it being used in production, when it is not a good idea to use some merge request branch as a basis.
Comment #25
init90One more way to install Drupal 9 compatibility patches - https://www.computerminds.co.uk/articles/apply-drupal-9-compatibility-pa...
But would be really great to see the patch commited.
Comment #26
8bitplateau CreditAttribution: 8bitplateau commentedMy composer is slightly different, this is what I have:
and installed via $ composer require "drupal/h5p:dev-3210822-drupal-9-readiness"
Comment #27
kuhikar CreditAttribution: kuhikar as a volunteer and at TATA Consultancy Services commentedI tried to apply patch: fixed.patch of #22
Executed below commands:
It is still providing the same error, please do check.
50/50 [============================] 100%
------ --------------------------------------------------------------------------------------------------------
Line src\Event\FinishedEvent.php
------ --------------------------------------------------------------------------------------------------------
10 Class Drupal\h5p\Event\FinishedEvent extends deprecated class Symfony\Component\EventDispatcher\Event:
since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
------ --------------------------------------------------------------------------------------------------------
[ERROR] Found 1 error
I am adding patch to existing fixed.patch file. Please do check : 3150110-drupal9_deprecated_report-27.patch
Currently, we are working on D9 Website and we need to integrate h5p module of D9 Version.
Comment #28
baikhoComment #29
kuhikar CreditAttribution: kuhikar as a volunteer and at TATA Consultancy Services commentedHello team,
Please, Is there any maintainer available to merge this PR and release D9 compatible module?
Can I get Core Committers - Release Managers role for this module?
Currently, we are working on D9 compatible website and this module needs to be updated in D9.
Please suggest.
Comment #30
larowlanI'm not a maintainer of this module, but my suggestion would be toe open a separate issue offering to be a co-maintainer and then follow the abandoned modules process
Comment #31
kuhikar CreditAttribution: kuhikar as a volunteer and at TATA Consultancy Services commentedHello Team,
Currently, we are migrating D8 to D9 and please help to merge patch so we will have 3.x version.
Please do check: Drupal 8 end-of-life on November 2, 2021 : https://www.drupal.org/psa-2021-2021-06-29
Kindly help us to release 3.x version.
@larowlan, thanks for the guidance.
Comment #32
dineshw CreditAttribution: dineshw as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedHello @paalj Any luck you able to cut. new release for h5p?
Comment #33
bharat.kelotra CreditAttribution: bharat.kelotra as a volunteer and commentedPlease do check: Drupal 8 end-of-life on November 2, 2021 : https://www.drupal.org/psa-2021-2021-06-29
I need the D9 compatible version of this module and as it is not available my whole site's d9 migration is kind of blocked due to this modules update. Can we please upgrade this module so that we can have a d9 compatible version?
Comment #34
bob.hinrichs CreditAttribution: bob.hinrichs commentedIs anybody out there? I don't understand the holdup for D9? There are people in this thread begging to contribute this change for us. We need this a year ago.
Comment #35
andeersg CreditAttribution: andeersg at Bouvet commentedAnyone have a timeframe for when a D9-compatible release will be ready? I tested the patch from #27 and it worked for me. Even a dev-release would be nice @kuhikar.
Comment #36
bezlash@gmail.com CreditAttribution: bezlash@gmail.com commentedA dev release would be fantastic and much needed. Any ETA around this?
Comment #37
worktapper CreditAttribution: worktapper commentedOpigno (https://www.drupal.org/project/opigno_lms) uses H5P and is releasing on D9 this week. They've not yet responded how they are handling H5P and D9, but they had to have addressed this months ago.
Comment #38
pjotr.savitski CreditAttribution: pjotr.savitski commentedIt seems that Opingo resolved that by just using the branch from an issue. More or less like this: https://git.drupalcode.org/project/opigno_lms/-/blob/3.x/composer.json#L30
Comment #39
NicholasS@pjotrsavitski I see how that project is using the dev branch, but how are you guys actually using composer to install the D9 module? I have been over this article as well no luck so far. https://www.mediacurrent.com/blog/how-fix-catch-22-problem-drupal-9-fixe...
Comment #40
pjotr.savitski CreditAttribution: pjotr.savitski commented@NicholasS My approach is a rather strange one and does not seem like something that is meaningful. There are a few examples of using the branch created for this issue in previous comment.
My approach was to just create a standalone repository that got the 8.x-1.x branch code for the 1.0-rc19 release. Then I applied the patch 7 (with a small change to resolve one issue, please see comment #22 for details). Then I've excluded drupal/h5p from Drupal composer repository, added my own repository as a source for the module. Here is how my repositories part looks like.
As I've also needed another module that depends on drupal/h5p@RC, the dev-SOMETHING version did no longer work. I've asked around on Drupal Slack and got a couple of suggestions. I've chosen the approach of tagging 1.0-rc19 release on my custom repository, which is in reality the original rc19 code + D9 patch.
This is how I required it:
"drupal/h5p": "1.0-rc19",
It seems that it would also be possible to write something like:
"drupal/h5p": "dev-3150110-drupal-9-readyness as 1.0-rc19",
I haven't tried the last one yet, but it will probably work.
What you are probably missing is the exclude part for the main drupal/h5p module so that official module repository would not be considered. I remember having a similar error before someone suggested exclusion.
I really hope that someone from Jouble will be able to patch in the D9 compatibility.
Comment #41
NicholasS@pjotrsavitski thanks you are correct #18 is how it needs to be done, I was missing the repositories info. https://www.drupal.org/project/h5p/issues/3150110#comment-14025504
I could not get the alias working "drupal/h5p": "dev-3150110-drupal-9-readyness as 1.0-rc19" gave a similar error
Searching over github I have seen a few other people do what you did an fork the entire repo
Comment #42
kenianbei CreditAttribution: kenianbei commentedIt boggles my mind that H5P devs haven't even commented on this issue, since D8 will be unsupported in about a month. Perhaps it's time for someone to go through the abandoned module process?
Like others I just duplicated the issue fork in github and I'm using that.
Comment #43
catchI've opened #3236765: Offering to co-maintain H5P.
Comment #44
thomasmurphy CreditAttribution: thomasmurphy at Xequals commentedhttps://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or...
Comment #45
robcarrThanks Pjotr for your solution (#40) - seems to have worked fine.
Let's hope a more permanent solution is made available soon: Drupal 8 is EOL in under a week.
Comment #46
pjotr.savitski CreditAttribution: pjotr.savitski commentedThere seems to be one more way for dealing with that issue without creating your own fork or using the issue specific branch, which makes sure that the patch that you have checked and reviewed will be applied.
The solution is based on the newly added lenient composer endpoint. I've followed the instructions from that page with one difference - the lenient repository is not the first one, which would make sure that it will only try to install the modules that I will explicitly add to excluded list. This will make sure that correct versions are preferred for all the packages except
drupal/h5p
.NB! Please note that I've used the latest patch available to date and I'm not sure that it's the one that I've reviewed and used for my custom forked repository! Check the code before you apply any patches! Use the content of composer.json file as an example.
The end result is that latest version of H5P Release Candidate is installed, patch will be applied and all will work as expected. The composer command will issue a warning text, but that is not should not be such a big deal.
One possible issue I see is that a new version of H5P module is released that would no longer allow the patch to be applied. That will probably throw an error on running
composer install
and/orcomposer update
commands. Maybe that is not a big deal as it will still be required to check if there is a D9 compatible version of the module available and this hack is no longer needed.Comment #47
robcarrSolution at #46 works well for me. Thanks again Pjotr - really appreciated.
Apparently code sprint planned for D9 module by H5P project. Not sure of timescales though.
Comment #49
vegardjo CreditAttribution: vegardjo at Bouvet commentedThese changes, bar one, seems to be fixed in the 2.* version of the module. There is a new patch that is needed for this, which can be found in #3266331: Use of deprecated function