Problem/Motivation
Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 10.
To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects
Periodically patches will be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted simply close this issue (any status besides Active, Needs review or Needs work) or remove the "ProjectUpdateBotD10" tag from the issue.
The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.
Proposed resolution
You have a few options for how to use this issue:
- Accept automated patches until this issue is closed
If this issue is left open (status of Active, Needs review or Needs work) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.
As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.
- Leave open but stop new automated patches.
If you want to use this issue as a starting point to remove deprecated API uses but don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD10" tag from the issue.
You can use Drupal Rector yourself to make these patches.
If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.
- Close it and don't use it
If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review or Needs work) and no more automated patches will be posted here.
If the issue is reopened, then new automated patches will be posted.
If you are using another issue(s) to work on Drupal 10 compatibility it may be useful to other contributors to add those issues as "Related issues" when closing this issue.
Remaining tasks
Using the patches
- Apply the patch in the comment by Project Update Bot.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
Providing feedback
If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Infrastructure project issue queue using the component “Bot: Drupal Rector”.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | ckeditor_templates_d10_3296778-28.patch | 4.03 KB | phernand42 |
| #25 | ckeditor-templates-patched.png | 120.08 KB | mtift |
| #23 | ckeditor_templates_d10_3296778-23.patch | 3.82 KB | captain_haddock |
| #19 | ckeditor_templates_d10_3296778-19.patch | 3.1 KB | jaspreet21 |
| #18 | 3296778-d10-compat.patch | 1.66 KB | b_sharpe |
Issue fork ckeditor_templates-3296778
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
project update bot commentedThis is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module this patch makes this module compatible with Drupal 10! 🎉
This patch updates the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #5
ajeet_kumarI reviewed with patch https://www.drupal.org/files/issues/2023-04-06/3273358-48.patch and found Drupal 10 deprecated issues as
..\contrib\ckeditor_templates\src\Form\CKEditorTemplatesDialogForm.php
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.. After resolving working as expected CKEditor.
Comment #6
ajeet_kumarComment #7
ajeet_kumarDrupal10 CKEditor_template CKEditor5 compatibility 3273358-48#51.patch
interdiff-3273358-48#51.txt
Comment #8
ajeet_kumarComment #9
abhijityadav commentedComment #10
falco010@ajeet_kumar Your patch has way more changes than needed.
To have Drupal 10 compatibility (to at least upgrade to it), you can use the existing fork that Lukey created above:
https://git.drupalcode.org/project/ckeditor_templates/-/merge_requests/5
The fork can be used by adding this to your composer.json repositories:
And run the following command:
Comment #12
gordon commentedI have been doing a lot of testing of this as a part of moving to Drupal 10. I have not found any issues and would make it so much easier.
If you can commit this would be such a huge help for my client.
Comment #13
vincent.hoehnHello folks. We used this module and needed the functionality urgently for CKEditor5 and Drupal 10, so we developed a plugin and module. For all of you who use the functionality, check out ckeditor5_template, maybe it's helpful for someone!
Comment #14
gordon commentedI did some more checking and I have removed the composer.json as it added no benefit and a better version will be generated by drupal.org
Comment #15
tom m fallon commentedHey @Gordon
I'm a little bit confused by this. At the moment most contrib modules I've ever come across contain a composer.json.
The reason for adding it was that I was getting
"No valid composer.json was found in any branch or tag of https://git.drupalcode.org/issue/ckeditor_templates-3296778.git, could not load a package from it. "
This error has now returned as my commit was reversed.
The benefit of having a composer.json (even if its replaced later via drupal) is it makes it a lot easier to interact with an issue queue branch. As it stands I've really only been left with the choice to fork this project until this issue merges.
Comment #16
smulvih2Agree with @tom, we should include a composer.json file in the module.
Can we get a D10 version released ASAP? I created a custom repository for this module (similar to comment #10) in order to bring this module up to D10. I also have ckeditor_templates_ui module in my build, which does have a D10 version. The only issue is that ckeditor_templates_ui requires ckeditor_templates, so in order to get working with D10 I would have to create a MR for ckeditor_templates_ui that points to the MR for ckeditor_templates, which I don't want to to. ckeditor_templates_ui is mandatory for my project in order to manage the templates.
Comment #17
gordon commentedYes can we please get this committed. It would make things much easier.
However I am using another tool called Drupal lenient, which can install modules that need to be that don’t quite match the criteria.
I am currently down to 2 remain modules which don’t have A d10 release.
Comment #18
b_sharpe commentedJust adding a simple D10 ready (no CKE5) to use with composer.
Comment #19
jaspreet21 commentedI am adding the patch which support Drupal coding standards as well in addition to comment number 18.
Comment #20
gordon commentedI merged in the @jaspreet21 changes. However I didn't include the changes to the info.yml as retaining compatibility with Drupal 8 is really not realistic.
Comment #22
marcoliverI agree with Tom that the composer.json should not have been deleted, because not composer refuses to load the module from the issue fork. I've reverted the commit that deleted the composer.json.
Comment #23
captain_haddock commentedUpdating patch with changes until 86558271
Comment #24
dpiRestoring to prevent #3383667: Automated Drupal 10 compatibility fixes
Comment #25
mtiftCode looks good, and I can confirm that the patch works. With Upgrade Status enabled and the patch applied, I see this:
Comment #26
mysdiir commentedCan also confirm that patch with Upgrade Status enabled works.
Comment #27
phernand42 commentedAfter updating to Drupal 10.1.5 (and using version 1.2 of module) I started getting the following error in node edit screen even after applying patch in #23.
I found that declaring the $themeExtensionList property at the class level, before it's used in the constructor made the error go away.
I'll revise patch in #23 to include this just in case anyone else encounters this error.
Comment #28
phernand42 commentedPatch re-rolled to fix error mentioned in #27
Comment #30
pasan.gamage commentedThe dependency for CK4 should be updated too I think.
https://git.drupalcode.org/project/ckeditor_templates/-/merge_requests/5...
Comment #31
steveoriolFor D10, dependency should be changed in the "ckeditor_templates.info.yml" file from
to
Comment #33
s_leu commentedUpdated the dependency to the ckeditor5 module as suggested in previous posts.
Comment #34
devil2005 commentedHi,
Can you release a stable version please (or a dev version that's ok too of course) ?
I have to use zip file and repository isn't up to date (branch 2.x is 3 years old)
Thanks
Comment #37
lucaslg commentedHi,
Sorry for the delay, I know people have been waiting for it. I didn't have much time to work on the subject.
But I did try to follow along the conversation. At first, I didn't understand why people worked on this version as CKEditor 4 support stopped at the same time as Drupal 9. But I discovered in the conversation that having a D10/CK4 version ease the transition of some project to Drupal 10.
I am not sure if the ThemeExtensionList service is the good one to use as it is marked @internal in the documentation and therefore should not be used as a public api if I read it correctly. But that can be corrected later in another issue if needed.
Thanks everyone who participated.
I'll look at the CKEditor 5 issue very soon to have another release.
Sorry again for the delay.
Comment #38
lucaslg commentedComment #39
joelpittet@lucaslg Thank you for tackling this! On big piece of the puzzle is in!