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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

Title: Followups for human-readable image style names (names with hyphens don't work correctly) » Followups for human-readable image style names (machine-readable names with hyphens don't work correctly)
Status: Active » Needs review
FileSize
1.92 KB

Here 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.

David_Rothstein’s picture

Issue summary: View changes

fix typo

Status: Needs review » Needs work

The last submitted patch, image-style-label-followups-1946580-1.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Needs review
andypost’s picture

Any reason hyphens are not allowed in form_process_machine_name() by default?
Maybe better to fix defaults?

David_Rothstein’s picture

I'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.

andypost’s picture

andypost’s picture

This RTBC but I'd like to expand this into all machine names

andypost’s picture

andypost’s picture

Issue summary: View changes

minor clarification

jhedstrom’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +needs-reroll

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Status: Needs work » Closed (cannot reproduce)
Issue tags: - +Bug Smash Initiative

I 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!