Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
drupal-check results on commit hash: fcca4f104b30c4ca52f4ded3c342ba83cb373691
------ ------------------------------------------------------------
Line src/Controller/FieldPermissionsController.php
------ ------------------------------------------------------------
98 Call to deprecated method getList() of class
Drupalield_permissions\FieldPermissionsServiceInterface.
148 Call to deprecated method getPermissionsByRole() of class
Drupalield_permissions\FieldPermissionsServiceInterface.
------ ------------------------------------------------------------
------ ---------------------------------------------------
Line src/Plugin/FieldPermissionType/CustomAccess.php
------ ---------------------------------------------------
106 Call to deprecated method getList() of class
Drupalield_permissions\FieldPermissionsService.
------ ---------------------------------------------------
------ ----------------------------------------------------------------------------------
Line tests/src/Functional/FieldPermissionsCommentTest.php
------ ----------------------------------------------------------------------------------
116 Call to deprecated function entity_get_form_display().
124 Call to deprecated function entity_get_display().
139 Call to deprecated function entity_get_form_display().
145 Call to deprecated function entity_get_display().
192 Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.
193 Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.
199 Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.
200 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
208 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
209 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
229 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
230 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
232 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
233 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
236 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
242 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
263 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
264 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
265 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
266 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
269 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
282 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
292 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
295 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
313 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
316 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
321 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
324 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
------ ----------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------
Line tests/src/Functional/FieldPermissionsNodeTest.php
------ -----------------------------------------------------------------------------------
77 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
85 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
91 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
100 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
110 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
118 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
119 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
127 Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase.
128 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
129 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
139 Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase.
140 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
144 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
154 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
155 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
------ -----------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------
Line tests/src/Functional/FieldPermissionsUserTest.php
------ -----------------------------------------------------------------------------------
23 Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.
76 Call to deprecated function entity_get_form_display().
80 Call to deprecated function entity_get_form_display().
84 Call to deprecated function entity_get_display().
97 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
102 Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.
113 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
125 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
136 Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
147 Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase.
148 Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
------ -----------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------
Line tests/src/Kernel/Plugin/FieldPermissionType/ManagerTest.php
------ -------------------------------------------------------------------------------
19 Usage of deprecated trait Drupal\simpletest\UserCreationTrait in class
Drupal\Testsield_permissions\Kernel\Plugin\FieldPermissionType\ManagerTest.
------ -------------------------------------------------------------------------------
[ERROR] Found 58 errors
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#33 | 3042752-32.patch | 19.61 KB | JeroenT |
|
Comments
Comment #2
Snehal Brahmbhatt CreditAttribution: Snehal Brahmbhatt at AddWeb Solution Pvt. Ltd. commented@mcdwayne, Please find the below-attached patch, & let me know if any further changes are required.
Thanks!
Comment #4
clemens.tolboomdrupal-check (https://github.com/mglaman/drupal-check) is about https://pantheon.io/blog/your-module-ready-drupal-9-click-here-find-out
Comment #5
JeroenTDrupal::service(...)
Should be \Drupal::service(...)
$this->assertSession() should not be used like that. See Drupal\FunctionalTests\AssertLegacyTrait for all alternatives.
E.g. $this->assertText() should be $this->assertSession()->pageTextContains().
$this->assertResponse() should be $this->assertSession()->statusCodeEquals()
and so on.
Comment #6
Snehal Brahmbhatt CreditAttribution: Snehal Brahmbhatt at AddWeb Solution Pvt. Ltd. commented@JeroenT, Please find the updated patch for the same, thanks for your inputs. Hope this works now.
Comment #7
Snehal Brahmbhatt CreditAttribution: Snehal Brahmbhatt at AddWeb Solution Pvt. Ltd. commentedComment #9
JeroenTEntityFormDisplay class should be imported.
This line seems odd. Should be replaced with $this->assertSession()->responseContains($this->commentSubject);
Comment #10
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedI am working on it.
Comment #11
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedHere is the correct patch. Kindly review and merge.
Comment #12
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedComment #14
AmandeepKaur CreditAttribution: AmandeepKaur at Valuebound commentedComment #15
-enzo- CreditAttribution: -enzo- at weKnow Inc commentedHi folks
I took the patch in comment #12, and solved to issues reported by drupal-check, but there two internal @deprecated issues that should be fixed or may be ignored.
Comment #16
-enzo- CreditAttribution: -enzo- at weKnow Inc commentedPlease ignore the files attached in the previous comment
Comment #17
-enzo- CreditAttribution: -enzo- at weKnow Inc commentedComment #18
xeM8VfDh CreditAttribution: xeM8VfDh commentedis this done and ready to be merged, and are we all squared away for D9 support after merging?
Comment #19
xeM8VfDh CreditAttribution: xeM8VfDh commentedI believe there is also acomposer.json
change that should be made to add the Drupal 9 support badge to the module's main page, as explained here: https://www.drupal.org/project/auto_entitylabel/issues/3111526EDIT: or perhaps the change needs to be made to thecore_version_requirement
field in the module's.info
file. Here's an example from another project: https://www.drupal.org/files/issues/2020-03-12/3119389-d9-upgrade-2.patchEDIT 2: my information about composer.yml and info.yml was incorrect, sorry. Apparently there is some switch the maintainer can flip to trigger the badge and mark the module as D9 compatible, but I don't know where that switch is since I am not a maintainer. Sorry.
Comment #20
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #21
xeM8VfDh CreditAttribution: xeM8VfDh commented@-enzo-, I applied patch field-permission-3042752-12.patch and I see no core deprecation warnings. However, I do still see the internal field_permissions warnings:
Seeing as this issue is about Drupal 9 compatibility, I think these internal deprecation are outside the scope of this issue, thus I am marking this as RTBC. Maintainers, should we open another issue about these internal deprecation warnings?
Comment #22
heddnI don't see any further deprecations then what are fixed in this issue. I've added a D9 test pass, to see if it catches things we can't find via static test analysis.
However, this module still needs
core_version_requirement: ^8 || ^9
to info.yml and (possibily)drupal/core: "^8 || ^9
. For that, marking NW.Comment #23
xeM8VfDh CreditAttribution: xeM8VfDh commented@heddn, can you provide that patch?
Comment #24
heddnI'll try to get to that. But I learned a few more things since I posted that comment yesterday and
core_version_requirement: ^8 || ^9
to info.yml is all that is needed.Comment #25
xeM8VfDh CreditAttribution: xeM8VfDh commented@heddn I have attached 3042752-13.patch, which includes
core_version_requirement
change. Please review.Comment #26
heddnThat looks good to me. Thanks for throwing up the patch. Here's an interdiff for anyone else between #16and #25.
Comment #27
xeM8VfDh CreditAttribution: xeM8VfDh commentedthanks @heddn
Comment #28
heddnWith D9 releasing today, any chance for a commit and new tagged release? Maybe a mention in the Drupal 9 support project field what the plans are for supporting D9?
Comment #29
xeM8VfDh CreditAttribution: xeM8VfDh commented+1
Comment #30
JeroenTTests are still failing.
EntityFormDisplay class should be imported.
Comment #31
xeM8VfDh CreditAttribution: xeM8VfDh commentedSorry, my fault, I am having issues running tests on my machine
attaching 3042752-13.patch to address #30. I'm not sure if the other test failures are related.
Comment #32
JeroenTComment #33
JeroenTComment #34
xeM8VfDh CreditAttribution: xeM8VfDh commentedsorry @JeroenT, thanks for cleaning up my mess *facepalm*
I just applied your patch 3042752-32.patch cleanly and it resolved the D9 deprecations. Again, I;m having trouble running test on my machine, but your testbot results obviously passed. So, if you aren't still working and 3042752-32.patch is your final patch, feel free to mark this RTBC.
Comment #35
JeroenT@xeM8VfDh, np.
Marking the issue RTBC.
Comment #37
japerryThanks all for working on this. Fixed!