- Issue created by @kim.pepper
- Merge request !4846Issue #3388985: Make CKEditor5ImageController reuse FileUploadHandler → (Closed) created by kim.pepper
- last update
over 1 year ago 30,124 pass, 7 fail - Status changed to Needs review
over 1 year ago 2:21am 22 September 2023 - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Changed CKEditor5ImageController to use FileUploadHandler.
I needed to add two things to FileUploadHandler to support this:
- Added
\Drupal\Core\File\FileSystemInterface::prepareDirectory()
to create the destination sub-directory - Added
\Drupal\Core\Lock\LockBackendInterface::acquire()
/::release()
which gets duplicated by JSON API and REST too, so we can move more logic to shared code in 📌 Deprecate file_managed_file_save_upload(), file_save_upload() and _file_save_upload_from_form() and replace with a service Needs review
- Added
- last update
over 1 year ago 30,164 pass, 1 fail - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
I rolled back the changes to FileUploadHandler.
Probably the most complex bc handling constructor I have tried so far.
Created a new issue for 📌 Add file upload lock handling to FileUploadHandler Needs review
- Status changed to Needs work
over 1 year ago 2:35pm 22 September 2023 - last update
about 1 year ago 30,193 pass, 2 fail - last update
about 1 year ago 30,205 pass - Status changed to Needs review
about 1 year ago 6:48am 23 September 2023 - Status changed to Needs work
about 1 year ago 4:47pm 24 September 2023 - Status changed to Needs review
about 1 year ago 10:15pm 24 September 2023 - Status changed to RTBC
about 1 year ago 2:18pm 25 September 2023 - last update
about 1 year ago 30,208 pass - last update
about 1 year ago 30,360 pass - last update
about 1 year ago 30,360 pass - last update
about 1 year ago 30,360 pass - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
about 1 year ago Waiting for branch to pass - last update
about 1 year ago 30,377 pass - last update
about 1 year ago 30,382 pass - last update
about 1 year ago 30,384 pass - last update
about 1 year ago 30,393 pass - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I didn't notice this because it's not in the component that the code actually lives in 😅
- Status changed to Needs work
about 1 year ago 9:54am 12 October 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Looks fantastic!
But, 2 questions, one of which is a bug in the logic (although it does not currently cause problems, hence the passing tests, but it'll make future maintenance more difficult/confusing).
50:50 50:41 Running- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Would this make 📌 [PP-1] Simplify CKEditor5ImageController once #2940383 lands Postponed obsolete too, or is that a further evolution of Drupal core's file upload handling?
- last update
about 1 year ago 30,397 pass - Status changed to Needs review
about 1 year ago 8:04am 14 October 2023 - Status changed to RTBC
about 1 year ago 6:34pm 14 October 2023 - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
I think we should postpone on 📌 Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface RTBC as we won't need to do the exception handling.
- Status changed to Postponed
about 1 year ago 3:26am 16 October 2023 - Status changed to Needs work
about 1 year ago 10:43pm 23 October 2023 - last update
about 1 year ago 30,427 pass, 2 fail - last update
about 1 year ago 30,427 pass, 2 fail - Status changed to Needs review
about 1 year ago 12:20am 24 October 2023 - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Updated to use constraint violations.
- last update
about 1 year ago 30,434 pass - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Postponing 📌 Add file upload lock handling to FileUploadHandler Needs review on this.
- Status changed to RTBC
about 1 year ago 3:02pm 24 October 2023 - 🇺🇸United States smustgrave
Deprecation seems correct
CR is present and makes sense about what is now needed. - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Reviewed this in detail. It looks excellent :)
We have detailed test coverage for this:
\Drupal\Tests\ckeditor5\Functional\ImageUploadTest::testUploadFileExtension()
\Drupal\Tests\ckeditor5\Functional\ImageUploadTest::testFileUploadLargerFileSize()
\Drupal\Tests\ckeditor5\Functional\ImageUploadTest::testLockAfterFailedValidation()
(Note that each of these asserts a 422 response is received when trying to upload something that is not allowed 👍
That's why I can confidently confirm this RTBC 😊
46:53 45:39 Running- last update
about 1 year ago 30,455 pass, 1 fail - last update
about 1 year ago 30,468 pass - last update
about 1 year ago 30,483 pass - last update
about 1 year ago 30,485 pass - last update
about 1 year ago 30,486 pass - Status changed to Needs work
about 1 year ago 5:04am 7 November 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Just one minor issue with the deprecation messages
- Status changed to RTBC
about 1 year ago 7:01am 7 November 2023 - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Back to RTBC (assuming green).
- last update
about 1 year ago 30,488 pass - Status changed to Postponed
about 1 year ago 9:28am 8 November 2023 - 🇬🇧United Kingdom longwave UK
While this is RTBC it is only a refactoring; ✨ Allow sites to programmatically opt in to accept more image type uploads in CKEditor 5: TIFF, SVG… Needs work is a major feature request that wants to make changes to the controller constructor as well, and I think it is worth postponing this issue on that one in order to try and get that into 10.2.x first; this can only go into 10.3.x/11.x as the parent issue did not land in 10.2.x.
- 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Well, this is disappointing given its blocked on a feature request, while this is removing duplicate code which has been the cause of numerous bugs (including security issues).
I would argue this has higher priority.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Yes, this fixes 🐛 [PP-1] CKEditor file upload sets file URI prior to validation, causing validators to be unable to find the file. Postponed
But because it relies on code from the parent issue that is 10.2 we're kind of hamstrung.
We might need to unpostpone 🐛 [PP-1] CKEditor file upload sets file URI prior to validation, causing validators to be unable to find the file. Postponed and reinstate the old approach there
- Status changed to RTBC
about 1 year ago 7:58am 9 November 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I think there's been a misunderstanding here. 📌 Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface RTBC did not actually land only in
11.x
… because10.2.x
was branched from11.x
AFTER #3375447 landed! That is the confusing part here 😅So: moving back to RTBC: this can land first just fine (and I think @kim.pepper's reasons above are sufficiently convincing — tagging accordingly), and then we can land the ✨ Allow sites to programmatically opt in to accept more image type uploads in CKEditor 5: TIFF, SVG… Needs work afterwards 👍
- last update
about 1 year ago 30,511 pass - 🇬🇧United Kingdom longwave UK
Not at computer to check but that is not what I remember nor what #3375447-26: Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface → says...
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
See https://www.drupal.org/project/drupal/issues/3375447#comment-15284269 📌 Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface RTBC the other issue was 11.x only, I confirmed with git
I'll unpostpone 🐛 [PP-1] CKEditor file upload sets file URI prior to validation, causing validators to be unable to find the file. Postponed
I don't think we should postpone this on the feature addition though, this is a nice piece of cleanup for 11.x part of a larger string of criticals that consolidate file upload handling.
- last update
about 1 year ago 30,516 pass - last update
about 1 year ago 30,530 pass - last update
about 1 year ago 30,552 pass - last update
about 1 year ago 30,555 pass, 2 fail - last update
about 1 year ago 30,602 pass - last update
about 1 year ago 30,605 pass - last update
about 1 year ago 30,634 pass - last update
about 1 year ago 30,675 pass - last update
about 1 year ago 30,678 pass - last update
about 1 year ago 30,684 pass - last update
about 1 year ago 30,688 pass - last update
about 1 year ago 30,688 pass - 🇳🇿New Zealand quietone
I read the issue summary and the comments. I did not find any unanswered questions or other work to do. I also think the change record is correct.
- last update
about 1 year ago 30,688 pass - last update
about 1 year ago 30,696 pass - last update
about 1 year ago 30,698 pass 31:34 29:42 Running- last update
about 1 year ago 30,724 pass - last update
about 1 year ago 30,764 pass - last update
about 1 year ago 30,765 pass, 1 fail - last update
about 1 year ago 25,901 pass, 1,825 fail -
larowlan →
committed 60a38dae on 11.x
Issue #3388985 by kim.pepper, Wim Leers: Make CKEditor5ImageController...
-
larowlan →
committed 60a38dae on 11.x
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Went to commit ✨ Allow sites to programmatically opt in to accept more image type uploads in CKEditor 5: TIFF, SVG… Needs work first but it has a phpcs fail.
So this one wins the 'who goes in first' prize.
Committed to 11.x and published change record.
Unpostponed 📌 Add file upload lock handling to FileUploadHandler Needs review
- Status changed to Fixed
about 1 year ago 1:20am 22 December 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- First commit to issue fork.
codebymikey → changed the visibility of the branch 3388985-make-ckeditor5imagecontroller-reuse-10.1.x to hidden.
- Merge request !6645Issue #3388985 by kim.pepper, Wim Leers: Make CKEditor5ImageController reuse FileUploadHandler → (Open) created by codebymikey
- Merge request !9229Issue #3388985 by kim.pepper, Wim Leers: Make CKEditor5ImageController reuse FileUploadHandler → (Open) created by codebymikey
- 🇳🇱Netherlands Lendude Amsterdam
Since FileUploadHandler doesn't have an interface and this plugin now hardcodes the used class, you can no longer decorate the file.upload_handler service and use this plugin without fatal errors ¯\_(ツ)_/¯
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
That seems worth an issue to add an interface
- 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Created 📌 Add an interface for FileUploadHandler Active