Problem
The EntityForm::setEntityManager has a deprecation notice that states that EntityForm::setEntityTypeManager is deprecated, pointing to use EntityFormInterface::setEntityTypeManager instead. This message can be confusing.
The deprecation error should state that EntityForm::setEntityManager (which triggers the error) is deprecated and not EntityForm::setEntityTypeManager (which will not be removed in 9.0).
Solution
Replace the error_msg on line 464 of core/lib/Drupal/Core/Entity/EntityForm.php with EntityForm::setEntityManager() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use EntityFormInterface::setEntityTypeManager() instead. See https://www.drupal.org/node/2549139
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | interdiff_10-14.txt | 844 bytes | himanshu_sindhwani |
| #14 | 3142943-14.patch | 1.91 KB | himanshu_sindhwani |
| #12 | 3142943-12.patch | 2.87 KB | himanshu_sindhwani |
| #10 | interdiff_4-10.txt | 697 bytes | ankitsingh0188 |
| #10 | 3142943-10.patch | 981 bytes | ankitsingh0188 |
Comments
Comment #2
jyotimishra-developer commentedComment #3
jyotimishra-developer commentedAssigning myself to work on this
Comment #4
jyotimishra-developer commentedComment #5
jyotimishra-developer commentedplease have a review the patch in #4
Comment #6
jyotimishra-developer commentedComment #7
himanshu_sindhwani commentedIt seems to me the error is just right but the function where I should be triggered is wrong, just corrected it.
Comment #9
ankitsingh0188Comment #10
ankitsingh0188Created the patch with the latest code of the module.
Created a patch to modify the incorrect deprecation notice.
Comment #12
himanshu_sindhwani commentedAdding the deprecated warning to both EntityForm::setEntityManager and EntityForm::setEntityTypeManager and updating test cases.
Comment #14
himanshu_sindhwani commentedMaybe we should create a different issue to add a deprecation warning for EntityForm::setEntityTypeManager, So here correcting the test failure in #10.
Comment #15
Rkumar commentedhttps://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
Though this is going to be depricated in D9
EntityForm::setEntityManager()As well as this URL also https://www.drupal.org/node/2549139 needs to be updated for
EntityForm::setEntityManager()Comment #16
Rkumar commentedI am not sure about the proper tag but yes more inputs are required for this update.
Comment #17
dpovshed commentedI had recently spotted the same issue and the patch in #14 worked perfectly. Despite it is about a year old it is perfectly applicable and eliminates misleading message.
* marking this as RTBC;
* removing the 'Discussion Post' tag - if there is really something to discuss it is advisable to reuse any of the standard tags.
Comment #18
catchComment #19
ravi.shankar commented@catch I think reroll of patch #14 on Drupal 9.2.x is not possible because the deprecated setEntityManager() method is removed in https://www.drupal.org/project/drupal/issues/3087546 this issue.
Please correct me if I am wrong.
So removing the Needs reroll tag and back to RTBC as per comment #17.
Comment #20
ravi.shankar commentedBack to the 8.9.x version.
Comment #22
catchOh I see, was confused by the 9.2 test in #14. We are not really committing minor issues to 8.9.x, but since this is specifically about deprecation documentation, let's get it in.
Committed/pushed to 8.9.x, thanks!