Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
image.module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
30 Nov 2019 at 11:17 UTC
Updated:
14 Aug 2020 at 16:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
avpadernoI would also change the name of the first parameter, as
$valueis a bit too vague.Comment #3
dev.patrick commentedComment #4
dev.patrick commentedAdding patch to update description for parameters and return value.
Comment #5
avpadernoGiven the code that calls that function, I would change the function description and add the parameters description as in the following patch.
Comment #6
avpadernoThe method I am referring in my previous comment is
CropImageEffect::applyEffect(), which contains the following code.Comment #8
kristen polTagging this issue for new contributors to work on during the Friday DrupalCon Global sprint.
Comment #9
ultrabob commentedThe patch applied cleanly and I thoroughly tested The crop and scale and crop image effects that use this function. They all continue to work as expected.
I agree that the new parameter names are much easier to understand, and the docblock does a nice job of explaining what the function does. I don't think the function name
image_filter_keywordis very intuitive, but I don't have a better idea either.It is a good improvement, and is in good working order.
Comment #10
avpadernoYes, the function name would make me think it filters text to give a keyword. Without seeing code that uses that function, I would not have imagined its purpose.
I thought of changing the function name too, but I also thought to replace the function with a class method. The problem in this case is finding the right class; given it's called from two image effect plugins, replacing it with a
ImageEffectBase's method could make sense, but it would not consider which third-party modules use that function. (Some of those modules would probably not expect to deal with the image effects base class.)Comment #11
jungleRedundant trail whitespace.
Could move to
defaultinswitch, for better readabilityAddressing the above two points. Meanwhile, would be better adding unit tests for image_filter_keyword(), but not sure if it's in scope, so stay RTBC.
Comment #12
kristen polI double checked the changes in #11 and they seem ok to me.
Please note that @ultrabob in #9 was working with me and @mradcliffe during the DrupalCon Global contribution day. I do see now that there are no screenshots so let us know if those need to be added to move this forward. Thanks.
Comment #13
avpaderno@KristenPol Screenshots of code aren't much helpful.
Everybody can verify the patch contains trailing spaces that need to be removed. A screenshot could eventually be a further prove that what reported is correct, but the confirmation of other users (including the user who provided the patch) should be sufficient.
(I shall remember to set Sublime Text to show the line endings, before creating a new patch.)
Comment #14
kristen polRight. Sorry, I was confusing this with a different issue that could be tested via the UI. Sorry for the noise.
Comment #15
avpaderno@KristenPol Asking what needs to be done to make a patch progress isn't noise at all. It's better to ask, when there are doubts.
Comment #16
alexpottCommitted 0eb1d66 and pushed to 9.1.x. Thanks!