This issue is for Drupal 8 followups for #606598: Human readable image-style names found while backporting the patch to Drupal 7.
The main one is that hyphens are no longer allowed in image style names in Drupal 8, but were in Drupal 7. This will cause issues because the style names people were using before will no longer be valid.
This patch just contains the simplest fix based on the one used in the Drupal 7 patch. An alternate fix was discussed in the above issue at one point (#606598-106: Human readable image-style names):
Why do we allow hyphens in image style machine names?
If it is really only because we supported hyphens before, then I'd highly prefer to adjust the upgrade path instead (in the separate issue) to convert all hyphens into underscores during the upgrade, which will have to rewrite many other things for image styles either way.
To the best of my knowledge there was no previous followup for it though.
Comment | File | Size | Author |
---|---|---|---|
#1 | image-style-label-followups-1946580-1.patch | 1.92 KB | David_Rothstein |
Comments
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedHere is the patch. It contains the only things I could find from the patch that is being worked on for Drupal 7 that would need to be dealt with in Drupal 8 too.
Comment #1.0
David_Rothstein CreditAttribution: David_Rothstein commentedfix typo
Comment #3
David_Rothstein CreditAttribution: David_Rothstein commented#1: image-style-label-followups-1946580-1.patch queued for re-testing.
Comment #4
andypostAny reason hyphens are not allowed in form_process_machine_name() by default?
Maybe better to fix defaults?
Comment #5
David_Rothstein CreditAttribution: David_Rothstein commentedI'd be happy to just allow hyphens everywhere in Drupal 8 also.
Based on the comment I linked to in the issue summary, I thought allowing hyphens everywhere might really be opposed by people (if, as indicated, they didn't even want to allow it in image styles going forward!)... so that's why I didn't write a patch here which did that. But from my point of view it would be fine and I think useful in certain situations.
Comment #6
andypost#1: image-style-label-followups-1946580-1.patch queued for re-testing.
Comment #7
andypostThis RTBC but I'd like to expand this into all machine names
Comment #8
andypostRelated issue #2049465: Upgrade of image styles and effects broken
Comment #8.0
andypostminor clarification
Comment #9
jhedstromComment #18
quietone CreditAttribution: quietone as a volunteer commentedI tested with Drupal 9.3.x, standard install. I created an image style with a hyphen in the name, make-small, it saved and I was able to use it to create an article.
Therefore, closing as cannot reproduce. If you are experiencing this problem reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!