This module contains a plugin which makes use of ContextAwarePluginBase which was deprecated after Drupal 9.1 and removed in Drupal 10, this has been re-written in the pathauto module to use the ContextAwarePluginTrait which this module looks to be based off, so I would suggest that this module should do the same.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff.txt | 1.42 KB | andy_w |
| #6 | 3356400-drupal-10-compatibility-6.patch | 3.36 KB | andy_w |
Comments
Comment #2
andy_w commentedComment #3
andy_w commentedComment #4
andy_w commentedAdditional to this Drupal 10 also requires all queries explicitly set accessCheck as part of the query (see https://www.drupal.org/node/3201242) therefore the request to fetch all view_mode_page_patterns requires ->accessCheck(TRUE) to support Drupal 10.
Comment #5
jerrac commentedI just found this module and was trying it out on a new D10 site. Since I ran into the ContextAwarePluginBase error, I tried patching via Composer/cweagans/composer-patches.
The 3356400-drupal-10-compatibility.patch file lets me see and use the full Add Pattern form, but when I submit, I get this error:
If I try to apply the interdiff.txt file alongside the .patch file, it fails to patch.
If I try the interdiff.txt file on it's own, the full Add Pattern form does not show up, and I get another error. (That I failed to copy, sorry.)
That's the end of my testing. Hope it might help.
Edit: Forgot my system info...
Drupal 10.0.9. View Mode Page 4.0.2. PHP 8.1.
Comment #6
andy_w commentedThanks for identifying this issue jerrac, I have updated the patch now that the node_type condition has been removed (see https://www.drupal.org/project/drupal/issues/1932810)
Comment #7
anybodyPlease see #3300706: Context exception when trying to create url (Drupal 10 is broken!) which is already RTBC'd. Should we close this one as duplicate?
Comment #8
james.williamsThere are differences between the two patches. This one adds an access check to an entity query. The entity query is for config entities, so the access check is not actually strictly necessary, but it does no harm to add it (and adding it will stop static analysis from unnecessarily flagging it up). On the other hand, this one does not account for 'entity_bundle' as the plugin ID... I don't know if that's OK or not.
Comment #9
chrisdarke commentedLooks like all these changes were applied to 4.0.3, can someone please mark this one as Closed (Fixed) because I was just going through checking why the patch no longer applies un-necessarily.
Comment #10
raphaelbertrand commentedit seems that at least the part on /src/Form/PatternEditForm.php by @andy_w is not yet in 4.0.3 as the error still happen
Comment #11
raphaelbertrand commentedon #3300706: Context exception when trying to create url (Drupal 10 is broken!)
there is a patch and MR waiting for merging wich solve the remaining issue.