Closed (outdated)
Project:
Drupal core
Version:
9.5.x-dev
Component:
editor.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Dec 2014 at 11:32 UTC
Updated:
22 Jul 2023 at 00:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
aneek commented@Wim Leers,
I was trying to make a test case that would validate the image's max dimension and resize it while upload. This piece of test can be useful to #2387011: EditorImageDialog passes incorrect arguments to file_validate_image_resolution issue. Need some of your help on this. The test case I've written so far is as following.
File: core/modules/editor/src/Tests/EditorImageDialogTest.php
I am not able to see the message in the editor page "editor/dialog/image/full_html" as The image was resized to fit within the maximum allowed dimensions of 100x100 pixels. Since there one issue with the
EditorImageDialog::buildForm()to take wrong array parameters as for image resolution validation, I have also fixed that one.Am I missing something in the test case?
Comment #2
aneek commentedUploading a patch that might help someone to check for the issues I was referring to in comment #1.
FYI not for bot review as of now.
Comment #3
aneek commentedComment #4
berdirYou can run the test anyway, it will happen sooner or later anyway.
Comment #5
aneek commented@Berdir,
I did locally but this should give an message "The image was resized to fit within the maximum allowed dimensions of 100x100 pixels" but it's not.
I think there may be coding issue with the test that I've written. It will be good if you or anyone can have a look after applying it locally.
Comment #6
catchComment #7
wim leers#2540850: (regression) EditorImageDialog alignment & captioning are not working added initial test coverage.
Comment #8
aneek commented@Wim Leers, great!! I will have a go on this.
Comment #9
aneek commentedComment #10
aneek commented@WimLeers, Uploading a basic test file. This does the following test validations,
Please review this and let me know what more can I add and improve in this patch.
Thanks!
Comment #11
aneek commentedComment #12
aneek commentedAdding #2588013: <span class="ajax-new-content" style="display:inline-block;"> causes unwanted whitespace as a related issue.
Comment #13
wim leers#10: Thank you so much for working on this! :) :)
It's not an "image editor", it's an image dialog for a text editor.
So: would be better.
Nit: s/a/an/
Nit:
{@inheritdoc}Nit: s/Setup/Set up/
Oh, WOW! I had no idea this existed :D Thanks :)
Shouldn't we also check which error message appears?
YES! What this method is testing is exactly what we very much need.
<3 <3
", as POSTed by the text editor's JavaScript."
Hrm… but this is just like
\Drupal\editor\Tests\EditorImageDialogTest::testEditorImageDialog(). It's not an integration test.This should use a POST request (
drupalPost()) and then verify the form that Drupal responds with matches our expectations.And do that for various editor objects being posted.
Does that make sense?
Comment #14
aneek commented#2588013: <span class="ajax-new-content" style="display:inline-block;"> causes unwanted whitespace is not related with this Issue.
Comment #15
aneek commented@WimLeers, thanks for reviewing the patch. I have some queries from #13. Though I'll ping you asking for those in IRC but I am also writing my queries here as well.
Or you have any better ideas?
Well yes, this is like
EditorImageDialogTest::testEditorImageDialog()and I've tested the loading of the editor with pre-loaded values. I've tried withdrupalPost()but might have misses something. So, where should the value will be posted? Is it going to be ondrupalPost('editor/dialog/image/full_html')or on a node creation page? I'll discuss with you on this point in IRC. Right now I can't be online :(Please let me know your thoughts. Thanks!
Comment #27
quietone commentedThis issue was discussed at a Bug Smash Initiative group triage meeting.
There has been no activity here for 7 years. Is this still valid? Perhaps, the test needed here was added in #2628656: Max dimensions do not apply to Editor Inline image or another issue?
Changing to PMNMI to determine if this still needs to be done before someone spends time on a patch,
Comment #29
smustgrave commentedSince there hasn't been a follow up to #27 going to close for now.
If still valid please reopen updating IS with what is still needed.
Thanks everyone!