Drupal-Check is providing errors. I am adding patch for resolving this errors on the existing patch: deprecated-code-report-3123971-16.patch
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | deprecated-code-report-3123971-16.patch | 11.78 KB | sker101 |
| #2 | 3123971-2.patch | 3.68 KB | suresh prabhu parkala |
Issue fork filebrowser-3123971
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
Comment #2
suresh prabhu parkala commentedPlease review the patch.
Comment #3
mistrae commentedStill having errors after applying the patch
web/modules/contrib/filebrowser/src/Presentation.php Line 115
Call to deprecated function tablesort_init(). Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Utility\TableSort::getContextFromRequest() instead.web/modules/contrib/filebrowser/modules/filebrowser_extra.info.yml
Add core_version_requirement: ^8 || ^9 to modules/contrib/filebrowser/modules/filebrowser_extra.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.Comment #4
suresh prabhu parkala commentedComment #5
mistrae commentedEdit : Was working on a patch, didn't saw you assigned it to you
Comment #6
mistrae commentedForgot the services.yml file
Comment #7
suresh prabhu parkala commentedComment #8
smrutha commentedPatch #6 works good.
drupal-check -d web/modules/contrib/filebrowser
41/41 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] No errors
Comment #9
smrutha commentedComment #10
clivesj commentedThanks for this. Let me review it and come back shortly.
Comment #11
sispro commentedOk
Comment #12
sker101 commentedThanks for the patch but it doesn't seem to be work for me due to the missing use statements in file src/Presentation.php from line 114 to 118.
I created an updated patch with following changes:
Comment #13
sker101 commentedMove back to "Needs Review" since the last reviewed patch wasn't working.
Comment #14
sker101 commentedAnother thing I noticed is I tried to upgrade to Drupal 9 using Composer after applying this patch but it still won't allow me to do so due to the following conflict error.
When I look at my `composer.lock` and I saw the module does requires core version of `^8.7.0`.
Since there is no `composer.json` in this module, I'm guessing it's using the "composer.json" served from "git.drupalcode.org" and will be addressed once this patch is committed?
Comment #15
jasonluttrellI am using Filebrowser 2.2-dev on Drupal 9.0.6. I have applied both patches, #6 and #12 above. In both cases, when saving a new Directory Listing (/node/add/dir_listing) I get the following error message:
Comment #16
sker101 commented@jasonluttrell
Good catch! this patch should fix the error.
I also tested it myself on Drupal 9.
The patch also removes the following warnings when creating folders.
Comment #17
jasonluttrell@sker101 the patch in #16 works beautifully. I did not get the error this time. Thanks! This should be RTBC.
Comment #18
devdesagar commentedHello Team,
Patch #16 is working for me tested on Drupal 8 and Drupal 9
Comment #19
devdesagar commentedComment #21
wizonesolutionsComment #22
wizonesolutionsOops! Issue summary reverted.
I made an issue fork that applies the patch and adds a compatible composer.json so that the project will work as a Composer repository in a Drupal 9 project. The composer.json part should probably not be committed to this project; the packaging system defaults are probably fine.
But hopefully this will be useful for anyone needing this now.
Comment #23
jcisio commented@wizonesolutions I'd like to know why an issue fork with extra composer.json is needed. Couldn't we just use a composer patch above or from an issue fork (for maintainability) without composer.json?
Comment #24
wizonesolutions@jcisio It’s just like I wrote in my comment: so that it will work as a Composer repository in a Drupal 9 project (a custom repository in the root composer.json).
Without that, it has to be added as a Git submodule or downloaded and patched manually because Composer will refuse to clone it normally (because of the composer.json version).
As mentioned, it was basically for me to use in a project, not intended to replace the patch as the solution.
Comment #25
jcisio commentedThank you. Got that. The current (automatically generated) composer.json does not even allow to add this project in Drupal 9, so can not patch it.
Comment #26
kuhikar commentedI have done following steps:
1. git clone --branch '8.x-2.x' https://git.drupalcode.org/project/filebrowser.git
2. goto root directory
3. drupal-check 'web/modules/contrib/filebrowser'
It was providing errors.
4. After that, I executed command: curl -O https://www.drupal.org/files/issues/2020-10-13/deprecated-code-report-31... in 'web/modules/contrib/filebrowser' directory and apply git apply patch deprecated-code-report-3123971-16.patch
5. Then I again executed below command. It is providing below errors.
drupal-check "web\modules\contrib\filebrowser"
41/41 [============================] 100%
------ --------------------------------------------------------------------------
Line src\Events\MetadataEvent.php
------ --------------------------------------------------------------------------
7 Class Drupal\filebrowser\Events\MetadataEvent extends deprecated class
Symfony\Component\EventDispatcher\Event:
since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
------ --------------------------------------------------------------------------
------ --------------------------------------------------------------------------
Line src\Events\MetadataInfo.php
------ --------------------------------------------------------------------------
7 Class Drupal\filebrowser\Events\MetadataInfo extends deprecated class
Symfony\Component\EventDispatcher\Event:
since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
------ --------------------------------------------------------------------------
------ ---------------------------------------------------------------------------
Line src\Events\UserActionsEvent.php
------ ---------------------------------------------------------------------------
7 Class Drupal\filebrowser\Events\UserActionsEvent extends deprecated class
Symfony\Component\EventDispatcher\Event:
since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
------ ---------------------------------------------------------------------------
[ERROR] Found 3 errors
6. I have added patch file: drupal9_deprecated_report-26.patch This file also including the changes of deprecated-code-report-3123971-16.patch.
7. Please download drupal9_deprecated_report-26.patch in the filebrowser directory and run: git apply drupal9_deprecated_report-26.patch in the module directory
8. Please run again below command, it is providing below output with No Errors.
drupal-check "web\modules\contrib\filebrowser"
41/41 [============================] 100%
[OK] No errors
9. Please review patch : drupal9_deprecated_report-26.patch
Currently, we are creating D9 compatible website and this module is in D8 compatible only. Please allow us to maintain this module.
Comment #27
jcisio commentedWouldn't patch #16 make this module incompatible with Drupal 8, because of dependency on Symfony 4?
Comment #28
kuhikar commented@clivesj
#16 : It is Drupal 8 and Drupal 9 Compatible.
#26: It is Drupal 9 compatible.
Can we consider #16 as RTBC for Drupal 8? But, it do not resolve drupal-check error.
Can we release Drupal 8 and Drupal 9 release version separately for this module.
Comment #29
jcisio commentedI don't think #16 is compatible Drupal 9. Because Drupal is shipped with Symfony 4, the event dispatcher has changed. So I think we should either create two releases (but it's harder for maintenance) or check Symfony version in code to use the correct argument for the event dispatcher.
Edit: in #27 of course I meant #26, sorry. #26 is not compatible with D8, and #16 is not compatible with D9.
Comment #30
AalokAtre commented@jcisio Symfony 4 still has "Symfony\Component\EventDispatcher\Event' class (marked as deprecated) as well as "Symfony\Contracts\EventDispatcher\Event" . Patch #16 should be RTBC as it is indeed compatible with D8 and D9.
While patch 26 can be released in a new 3.x branch as it will D8 incompatible.
Comment #31
clivesj commentedSo it sounds like we do require 3.x branch for D9 (based on #16) and apply #16 to the current branch. Correct?
Comment #32
jcisio commented@AalokAtre https://www.drupal.org/node/3159012 we would need the bridge for Drupal 9.1, but it would be a bit more complicated.
So I think the way to go is patch #16. Has anyone tested it in Drupal 9.1 and 9.2?
Patch #26 would be D10 material.
Comment #33
kuhikar commented@jcisio:
I have followed below steps for #16:
For 9.1.0:
For 9.2.0:
The problem with #16 is only with drupal-check. When we are running drupal-check, it is providing us warning. That I have resolved in #26. Kindly check #26 for the same.
@clivesj: Please we require 3.x branch for D9 (based on #26) and apply #16 patch to current branch.
Comment #35
kuhikar commented@clivesj:
#16: sker101 is actually the author of the patch.
#26: kuhikar is author of this patch.
Can you please give credit to sker101 for #16.
Comment #36
clivesj commentedCommitted #16 to 8.x-2.3 (D8 only)
Committed #26 to 3.0.0 (D9 only)
Thanks to all.
Comment #39
hotwebmatter commentedI have created an updated issue fork to use as a transitional package while testing Drupal 9 compatibility in Drupal 8.9.18.
I didn't want to use the issue fork created by @wizonesolutions in https://www.drupal.org/project/filebrowser/issues/3123971#comment-13910338, because it needed to be rebased off the latest D8 version.
This issue fork is only useful if you need to install a Drupal 9 compatible version of the project in Drupal 8, as a transitional package during an upgrade. If you are starting a Drupal 9 project from scratch, just use version 3.0.0 (D9 only).
I've been making Merge Requests of these D9 compatibility issue forks, with installation instructions. But in this case, the code should not be merged, so I won't bother with the MR.