Problem/Motivation
I am not entirely sure when it became a requirement to switch from EntityManagerInterface to EntityTypeManagerInterface, but I am developing in 8.7-beta2 and there is a fatal error being triggered at the construction of the TermMachineName class (namespace Drupal\taxonomy_machine_name\Plugin\views\argument_validator).
The deprecation notice for EntityManagerInterface says it will be removed "before 9.0", and I can't find any change records requiring it to be replaced with EntityTypeManagerInterface in 8.7. I do believe that EntityTypeManagerInterface has been useable since 8.1. So I don't think there is any downside to implementing this change now.
Steps to reproduce
1. In a new or existing view, click to add a contextual filter.
2. Choose a field. I don't think it matter which you choose.
2. You won't reach the configuration dialog since that AJAX load will fail when attempting to construct the plugin.
Watchdog shows:
TypeError: Argument 4 passed to Drupal\taxonomy_machine_name\Plugin\views\argument_validator\TermMachineName::__construct() must implement interface Drupal\Core\Entity\EntityManagerInterface, instance of Drupal\Core\Entity\EntityTypeManager given
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3048220_unix_line_endings-6.patch | 967 bytes | joseph.olstad |
| #2 | 3048220-0.patch | 983 bytes | jonmcl |
Comments
Comment #2
jonmcl commentedComment #3
sergiu stici commentedPatch #2 works for me.
Comment #4
aless86 commentedHi, I've noticed that the Line separator of TermMachineName.php class is CRLF instead of LF and it's the reason why the patch doesn't apply.
Could you change it?
Thanks a lot.
Comment #5
jonmcl commented@Aless86 #4: I think the original file is using CRLF, so my IDE maintained that. The patch shows the same. I can change the file to only LF, but then the patch will contain a replacement for every line of the file.
Other files in the module seem to be LF, so it must've been an accidental thing. Unfortunately the .patch file ends up being a mixture since I created it with git diff on a Mac. But since the original file has CRLF, I think it's technically a correct patch. I'm not sure if it can be applied if the CRLF is removed from the patch file (but remain in the original source file).
Comment #6
joseph.olstadRTBC this patch.
patch 0 has windows line endings, causes trouble with normal environments.
uploading new patch
fixes our issue
Comment #7
ldenna commentedRTBC +1
Comment #8
delalis commentedRBTC +1
Comment #9
slefevre@ccad.edu commentedRTBC +1
Comment #11
joseph.olstadsee upcomming release.
to be tagged today
Comment #12
joseph.olstadThis fix is available in 8.x-1.0-beta4, the owner of this project kindly granted me with access. So I pushed up this patch and tagged and pushed a new release.
Thanks everyone!
Comment #14
kristen polPer a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.
Comment #15
joseph.olstadKristen, there was a release with the update of the deprecated call.
Why is this issue tagged for Drupal 9 compatibility? check the latest release, it is already Drupal 9 compatible