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.
Does webform need to look for ckeditor.fakeobjects? We already have a module that uses fakeobjects but the library is called fakeobjects and not ckeditor.fakeobjects. Also based on the name of the zip file looks like it should just be named that. Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#18 | 3171426-18.patch | 1011 bytes | jrockowitz |
#16 | 3171426-16.patch | 1011 bytes | jrockowitz |
#2 | webform-ckeditor-fakeobjects-3171426-2.patch | 1.33 KB | smustgrave |
Comments
Comment #2
smustgrave CreditAttribution: smustgrave commentedComment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedDrupal does not have central mechanism to download external libraries. I wanted to namespace most of the libraries to prevent conflicts. We might be able to add some directory detection code.
What module are you using?
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI found the fakeobjects.module which is a dependency of the anchor_link.module.
Looking at the other ckeditor plugins like image and link I think it makes sense why I prefixed them with 'ckeditor.*'
I think the safer solution, it to have fakeobjects.module and anchor_link.module account for the ckeditor.* prefix. This would be a very minor patch.
Comment #5
smustgrave CreditAttribution: smustgrave commentedFakeobjects was the the module I was thinking of.
Comment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedFor example, removing the 'ckeditor.*' prefix would cause problems with the 'ckeditor.codemirror' plugin because there is already a 'codemirror' directory.
The best compromise might be to add support ckeditor plugins without the ckeditor.* prefix. Meanwhile the webform library related drush command, composer.libraries.json, and zip archive would still use the prefix.
Comment #7
smustgrave CreditAttribution: smustgrave commented"merge-plugin": {
"include": [
"wwwroot/modules/contrib/webform/composer.libraries.json"
]
}
I added this to my composer and it grabs all the libraries but the ckeditor.fakeobjects. So does it do some check for the fakeobjects library?
Comment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI think we are not going to be updating composer.libraries.json. If a website has the fakeobjects.module installed they would have build their own composer.libraries.json file.
Comment #9
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe CKEditor CodeMirror module addressed this challenge by support multiple directories via #2901069: Slight re-architecture without library dependency
My suggestion from #6 is getting a little ugly and does not solve the fact the the webform module would still generate composer.json files using the ckeditor.* prefix.
We might want to approach the maintainers of these ckeditor plugin modules and see if they are open to supporting the ckeditor.* namespace.
BTW, I don't love having the webform module's choice of library directory names having an impact other modules external libraries.
Comment #10
smustgrave CreditAttribution: smustgrave commentedFully understand. My question from #7 was though I pulled in webform's composer.libraries.json and it added all the libraries to my repo which was desired. I already had a fakeobjects library but since webform is pulling in ckeditor.fakeobjects I would expect that folder to have appeared also but it didnt'. Any idea? Curious if the same thing would of happened to say ckeditor.link if I already had the link folder.
Comment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedYes the webform modules composer.libraries.json should always create a /libraries/ckeditor.fakeobjects and /libraries/ckeditor.link directory.
Comment #12
smustgrave CreditAttribution: smustgrave commentedBut it didn’t create the ckeditor.fakeobjects folder. I’m assuming since I already had just a fakeobjects folder.
Comment #13
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI can't reproduce the issue from #12.
My steps are…
composer.json
to merge webform'scomposer.libraries.json
composer update
/libraries/ckeditor.fakeobjects
to/libraries/fakeobjects
composer update
/libraries/ckeditor.fakeobjects
and keep/libraries/fakeobjects
Comment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI am not comfortable changing the destination of all CKEditor related plugins, mainly because of the ckedior.codemirror plugin, which shows that there would be some immediate conflicts with this change.
For sites, that do not want to use the ckeditor.* prefix, they can implement the below hook, which will removes the ckeditor.* prefix when CKEditor plugins are placed in /libraries (i.e: /libraries/fakeobjects). These site would have generate update their composer.json using
webform:composer:update
.I think this is a fair compromise.
Comment #15
smustgrave CreditAttribution: smustgrave commentedSeems very fair to me. I’ll post a patch to the fake objects module with this. Thanks!
Comment #16
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedInstead of having multiple modules add this hook, we should just add this code snippet to the Webform module.
Comment #17
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #18
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #20
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI am very comfortable with the patch from #18 (the 1 test failure can be ignored), so I committed it. Please download the latest dev release to review.
Comment #21
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented