Original report by @jenlampton
Problem/Motivation
On the image field settings form, the two field labels "Maximum image resolution" and "Minimum image resolution" should really be "Maximum image dimensions" and "Minimum image dimensions" .
Though wikipedia admits that the former is commonly used to mean 'dimensions', this tends to trip up people with print or graphic design backgrounds, who actually expect to limit an image's true resolution.
Proposed solution
In Drupal 10 and 11, We should update all the user interface text, and corresponding code to all these values dimensions instead of resolutions.
In Drupal 10 and 11 we may need to provide an update hook to move variables in the field config tables from the old D7 names to the new D10 and 11 names.
In Drupal 7, we should update only the user interface text.
Remaining tasks
- D10 and 11: Update user interface text
- D10 and 11: Update code to match UI
- D7: Update user interface text only.
User interface changes
- "Maximum image resolution" should become "Maximum image dimensions"
- "Minimum image resolution" should become "Minimum image dimensions"
API changes
- function rename (in file.module):
function file_validate_image_resolution(FileInterface $file, $maximum_dimensions = 0, $minimum_dimensions = 0) is renamed to "file_validate_image_dimensions"
- method rename (in class ImageItem):
public static function validateResolution($element, &$form_state) is renamed to "validateDimensions"
Related issues
#1134022: Update "Maximum image resolution" to read "Maximum image dimensions"
#1215730: Terminology update: don't say "Resolution" when we mean "Dimensions"
Beta phase evaluation
| Issue category | Task because it is rewriting a user interface string for clarity |
|---|---|
| Prioritized changes | The main goal of this issue is usability. |
| Disruption | This is not disruptive, because it renames two little-used APIs and leaves a BC layer in place. |
| Comment | File | Size | Author |
|---|
Issue fork drupal-1215784
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:
- 1215784-terminology-update-dont
changes, plain diff MR !5227
Comments
Comment #1
droplet commentedAgreed
Comment #2
Tor Arne Thune commentedTagging.
Comment #3
lambic commentedlooks good
Comment #4
tr commentedFunction names should be changed too, to agree with the terminology. For example, testResolution() should be renamed testDimensions(), now that the function comments all say dimensions instead of resolution.
These are the functions I found referenced in the patch:
testResolution()
testFileValidateImageResolution()
file_validate_image_resolution()
_image_field_resolution_validate()
Comment #5
jenlamptonupdated everything in D8, only UI in D7.
Comment #7
jenlamptonThis time with changes to file module too.
Comment #9
jenlamptonThis time without my other work in it :)
Comment #11
jenlamptonThis time updating simple test and user module too.
Comment #12
kgoel commentedTested the patch in Drupal 8 and it is looking good in user interface and code.
There is user.module.orig file in the patch which needs to be removed from the patch as per http://drupal.org/node/1268890.
Druapl 7 user interface is looking good too but this makes some changes in the code. Does it mean that patch needs to backport to Drupal 7 also?
Comment #13
jenlamptonI couldn't find any .orig files in the patch, perhaps git added them to your codebase when you applied the patch?
rerolling anyway since we are out of date.
D8 version changes all incorrect instances of 'resolution'
D7 version only updates the UI.
Comment #14
scresante commented#13: core-dimensions_not_resolution-1215784-13.patch queued for re-testing.
Comment #16
scresante commentedChanges made to user.install , reroll
Comment #17
scresante commentedComment #18
jeffschulerD8 patch looks good!
Tested with image fields on content types and default user picture field.
Comment #19
webchickI would've expected to see an upgrade path here from D7 sites using the old name? There are hunks that touch update functions, but they look like find/replace.
Comment #20
jbrown commentedD8 currently migrates user pictures into image fields.
The patch in #16 updates the migration code so it still works:
Comment #21
jbrown commented#16: core-dimensions_not_resolution-1215784-16.patch queued for re-testing.
Comment #22
bleen commentedI think you are missing webchick's point here ... if the variable was named "foo_resolution" in D7, then I would expect that an upgrade to D8 would create a new variable called "foo_dimensions" and that it would get its initial value from "foo_resolution". That is not what is happening here.
At some point i would expect to see something that looks like this:
Comment #23
quicksketchAnd additionally, we'd need to go through all the fields and update the widget settings for all fields to rename resolution to dimensions. I'd love to see this fixed too.
Comment #24
jbrown commentedThe variable is called "user_picture_dimensions" so it already has the correct terminology. It gets deleted in user_update_8011() because it is migrated into field config. The patch in #16 is correct in this regard because it changes user_update_8011() so the field config that is being created uses the new config item names.
Comment #25
quicksketchAh, clever. Well that means a definite breakage of existing 8.x sites. I'm not sure where this fits in our policies. I think it's basically, "make 8.x-to-8.x upgrades work if it's easy, but breaks are okay if upgrades are hard". That seems to describe this situation, so maybe no new updates are needed.
Comment #26
jeffschulerRerolled.
Changes in
core/profiles/standard/standard.installgot moved intocore/profiles/standard/config/field.instance.node.article.field_image.yml.Comment #27
jeffschulerthe patch...
Comment #28
jeffschulerI am seeing, (as quicksketch suggests in #23) that on D7 => D8 upgrade, the field instance settings haven't been changed.
I'm not yet sure where this should get updated.
Comment #29
jeffschulerComment #29.0
jeffschulerIssue summary stuff, better.
Comment #30
alansaviolobo commentedrerolled the patch.
Comment #32
jayelless commentedComment #33
jayelless commentedI have completed the terminology changes and rolled a new patch.
Two API changes to note:
1. The function "file_validate_image_resolution" has become "file_validate_image_dimensions"
2. The method "validateResolution" in class imageItem has changed to "validateDimensions"
The Interdiff file is also attached.
Comment #34
jayelless commentedI realised that I did not create the interdiff for patch #33 correctly, so have re-done it properly.
Comment #35
jayelless commentedComment #36
jayelless commentedComment #38
jayelless commentedPatch re-rolled against latest 8.0.x HEAD.
Comment #41
jayelless commentedPatch re-rolled against latest drupal-8.0.x.
Comment #44
jayelless commentedIs this a "beta deadline" issue?
Comment #45
catchNo not really, there's one API change in the patch:
That's not going to affect much, so I'd allow it during early beta. We could leave the old function as a wrapper and mark it @deprecated past that if we need to.
However it changes configuration, so it does need to be 'beta target'/'D8 upgrade path'. If it doesn't get committed before we start the upgrade path, then either:
1. We'd have to skip the bits touching configuration.
2. We'd have to write an upgrade path. Depending on what the upgrade path looks like, that could also mean the issue being delayed until 8.1.x or 9.x if it might be disruptive.
Comment #46
anavarreComment #47
linl commentedLooks like this needs a reroll now that #657166: use × instead of x is in.
Comment #48
jayelless commentedPatch has been rerolled against the latest 8.0.x HEAD.
Comment #49
nishruu commentedI checked the patch for D8 :
- in code every reference to "resolution" has been replaced.
- in UI, everything looks OK now.
Comment #50
Anonymous (not verified) commentedReviewed and did not find any problems
Comment #51
nishruu commentedTo develop what catch said in #45, we should make the old function a wrapper containing the new function (marked as deprecated), so it will up to everybody which one they want to use. We won't break anything doing this.
Comment #52
Anonymous (not verified) commentedI will create the (deprecated) wrapper function to provide this
Comment #53
stephaneqHere is the patch
@leonrenkema sorry I forgot to assign the issue to myself
Comment #54
Anonymous (not verified) commented@StephaneQ No problem, I've reviewed the patch and it is the same as I created.
Comment #55
mauzeh commentedThis issue will be reviewed after the test comes back.
Comment #56
nishruu commentedThe wrapper works and the old function is now indicated as deprecated. RTBC.
Comment #57
jayelless commentedShould the other API change:
also be made into a wrapper and marked as deprecated?
My bad! This API change has disappeared in one of the recent core changes. Just ignore this comment :)
Comment #58
jayelless commentedComment #61
gábor hojtsyLooks like a random/unrelated fail. Only one remark on the patch:
Our docs standards at https://www.drupal.org/coding-standards/docs#deprecated suggests a one line explanation and @see to point to the one to use instead.
Comment #63
penyaskitoRerolled, conflicted with #2363077: Max and min resolution not working. Removed assigned field as it has been a long time without work here.
Comment #64
penyaskitoFixed #61 and fixed phpdocs in
file_validate_image_dimensions().Comment #65
penyaskitoFound more occurrences. This should be good to go. Take into account that there are some references, but they are in migration sources so they must not be modified.
Comment #66
penyaskitoOops! s/dimension/dimensions/g
Comment #70
ianthomas_ukDocs standard is that the first line should be a brief explanation of the function, followed by more detailed information. I'd suggest:
/**
* Backwards compatibility wrapper for file_validate_image_dimensions().
*
* @deprecated in Drupal 8.0.0, will be removed for Drupal 9.0.0.
*
* @see file_validate_image_dimensions()
*/
I've also tweaked the @deprecated line, as discussed in #2158871: [Policy, no patch] Clearly denote when @deprecated code is slated to be removed.
Doesn't seem necessary to add the parameter types here, but if we're going to then they should be string (see the descriptions).
This should be mixed, because it might return an error string.
ARE within bounds, not is.
Comment #71
sanjusci commentedHere is my first patch, please review.
Comment #72
gábor hojtsyFix tag. Please announce at your sprint that the right tag does not include a #.
Comment #73
zaporylieComment #76
ianthomas_ukGreat to see a new contributor - thanks for your patch. Unfortunately looking at your interdiff, you've broken the backwards compatibility wrapper and undone one of the previous changes from resolution to dimensions, neither of which are changes we want. There are no other changes, and #70 has not been addressed. If you give your interdiff a .txt extension, then that will stop it being picked up by the testbot.
Any further patches should be based off #66.
Comment #79
Saphyel commentedComment #80
Saphyel commentedI tried to use @penyaskito patch but it doesn't apply... :(
I think I didn't forget change any image resolution...
Comment #81
Saphyel commentedComment #82
penyaskitoThanks for your patch!
Unfortunately you've broken the backwards compatibility wrapper. We need to maintain that.
See this from #66:
Comment #83
Saphyel commentedComment #84
Saphyel commentedBad patch!
Comment #85
Saphyel commentedtest patch 2
Comment #86
Saphyel commentedThis is the correct second patch. I apologize for my noob uploads before...
Comment #87
Saphyel commentedComment #88
Saphyel commentedComment #89
penyaskitoThanks for your perseverance! See the docblock documentation at #70 for the deprecation notice and use it, please.
Comment #90
Saphyel commentedDone! and thank you for your time, I appreciate it ^^
Comment #91
penyaskitoExtra i.
*are* within bounds.
See extra comments at #70, I think we are missing some of those again.
Comment #93
Saphyel commentedComment #94
Saphyel commentedFixed extra "i", documentation and added backward compatibility
Comment #95
penyaskitoGo, testbot!
Comment #96
penyaskitoI think this is ready if green.
Comment #97
Saphyel commentedComment #98
alexpottWe need a change record for the schema changes and I think it would be good to inform everyone of the change in terminology.
Comment #99
penyaskitoSource shouldn't have changed, these represents the D6 stored data.
This shouldn't have changed because it's the D6 db dump.
Comment #100
penyaskitoCreated change record draft: https://www.drupal.org/node/2423061.
Comment #101
Saphyel commentedComment #102
Saphyel commentedComment #104
Saphyel commentedFix test
Comment #105
webchickOMG your avatar is AMAZING. :D Steampunk Druplicon? :)
Comment #106
Saphyel commentedI forgot interdiff :(
@webchick yes!! it's http://suntog.deviantart.com work. I fall in love when I saw it <3
Comment #108
Saphyel commentedHidden fail test found.
Comment #110
Saphyel commentedComment #111
Saphyel commentedFix source d6
Comment #113
Saphyel commentedI remake the patch
Comment #115
Shivam Agarwal commentedGreat work of patch #113 by Saphyel. Patch worked perfectly on D8 and on PHP 5.6.3 with UI updated. Screenshot of UI after applying patch is attached with comment.
Comment #116
Shivam Agarwal commentedComment #117
Shivam Agarwal commentedAltered comment #115 by adding two files as attachment. One image named as before_applying_patch.png is the screenshot of D8 UI before applying patch mentioned in comment #113 and another image named as after_applying_patch.png is the screenshot of D8 UI after applying patch.
Comment #118
alexpottThe disruption part of the beta evaluation is incorrect - existing image fields need to be updated and whilst we are not yet support head to head upgrades we should at least be honest about this. Actually I think the configuration key renames are not worth it at this point. We break existing sites for little reason. I think this issue should be postponed to 9.x.
Comment #119
Shivam Agarwal commented#alexpott but why this is so? why it shouldn't be included in Drupal 8 version inspite that patch is working completely fine?
Comment #120
Patrick Storey commentedI am removing the Novice tag from this issue because it is uncertain if this should be postponed or not.
I’m using this documentation as a source: https://www.drupal.org/core-mentoring/novice-tasks#avoid
Comment #121
nlisgo commented@Shivam, the main issue here appears to be that the beta evaluation does not accurately reflect the disruption caused by the patch.
See: https://www.drupal.org/contribute/core/beta-changes#disruption (the last 2 points are particularly relevant)
@alexpott is challenging the value of the fix against the disruption that it will cause particularly to those currently hosting D8 beta sites.
It is our responsibility to put a case forward for the value of this patch.
Comment #122
xjmThis issue was marked as a beta target for the 8.0.x beta, but is not applicable as an 8.1.x beta target, so untagging.
This change includes some disruption, so moving to 8.2.x. It's also way more than just interface text in the current patch. One could split the UI changes from a followup for the variable and machine name changes to address this.
Comment #125
Trupti Bhosale commentedGetting error on applying the patch '1215784-dimensions-113.patch' in #113 on Drupal 8.4.x site.
This needs to be reworked.
Comment #126
Trupti Bhosale commentedComment #137
quietone commentedUpdating tag.
Comment #140
simohell commentedThis issue is still very much valid and came up in the last Usability meeting #3395398: Drupal Usability Meeting 2023-10-27 as we reviewed an issue on resizing image. This should be done everywhere: replace incorrect "resolution" with the correct "dimensions" especially for all user facing texts.
I wonder of this could be split to 2 issues to provide the first easier fix faster?
I removed some of the tags that listed old events.
Comment #141
lauriiiSplitting the variable / API changes to a separate issue was recommended by @xjm in #122 so that seems like a good way to proceed here.
Comment #143
simohell commentedI made updates to comments and user interface changing the word resolution to dimensions where relevant.
This does not change wording where referencing Drupal 6 terms (migration).
Does not update any variables and that would be a follow-up issue.
Comment #144
smustgrave commentedOpened #3399094: Update variable/API terminology to not use "Resolution" so removing "Needs follow up" tag
Since API changes were moved to follow up removing upgrade path and change record tag. Believe the attach CR on this issue could probably be deleted.
String freeze and minor version target I don't recognize but don't think they fully apply.
Looking at MR 5227 I only see label and comment changes so seems in scope of this issue.
Comment #145
xjmAssuming the MR is canonical here since the patch files are very old. Please remember to hide patch files when converting a patch to an MR. Thanks!
Comment #146
xjmComment #147
xjmSaving issue credits. (That took awhile.)
Comment #149
xjmI reviewed locally with
git diff --color-wordsand verified that all the changes are updating code comments or UI strings where "resolution" is incorrectly used for image dimensions.I grepped for:
I verified that there were no other inline comments incorrectly referring to image dimensions as "resolution".
I grepped for:
...to check for the same thing in docblocks. Doing so, I found the following files where the word "resolution" is used to mean "dimensions" in the docblock summaries for several test methods:
Renaming the parameters or test methods themselves is scoped to the followup, but the docblocks should be updated now.
I grepped for:
...to check for obvious translatable strings containing the word. Image resolutions are mentioned in
image_help(), but in that case it's maybe correct? Please evaluate whether you think this should be changed or not:Do they simply mean a large image, or do they mean a high-resolution image?
NW to at least fix the three test docblocks. Thanks!
Comment #150
simohell commentedI updated the 3 tests for word "dimensions".
I had deliberately left out changing the "high-resolution" part since it makes sense if read according to for instance Adobe's definition
"High resolution images are pictures or photos where the media has higher concentrations of pixels or dots, resulting in better quality and clarity of the image – as it contains more detail."
A number of end users deal with high-resolution photographs and the help-text would make sense to them. In the past the industry used terms like "press quality", "print quality" or "web quality" and here press & print would be high-resolution and web quality low-resolution. The help text communicates that Drupal handles original high-resolution photos just fine.
Comment #151
simohell commentedComment #152
smustgrave commentedAppears feedback for the 3 dockblocks has been addressed.
Comment #155
xjmThanks @simohell; that explanation works for me.
Committed to 11.x and 10.2.x as it includes minor-only updates to UI strings. Thanks!
Comment #156
xjmI went to publish the CR, but then realized it should actually be about the API and data model changes, not the simple string changes. So I removed it from this issue and reattached it to the followup instead.