Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2944419 - Hero images for custom content types when machine name is too long #728

Merged
merged 4 commits into from Feb 14, 2018

Conversation

jaapjan
Copy link
Contributor

@jaapjan jaapjan commented Feb 13, 2018

This is a copy of the original pullrequest #727 and the issue can be found here: https://www.drupal.org/project/social/issues/2944419

Problem

If you use a custom content type (not provided by Open Social) and happens to have a long name, the validation above will fail because machine names can only be 26 characters long.
In order to at least have the possibility of having an image set, new code needs to load an image field as hero, as long as it has the word "image" on its field name and it is an image field.

Solution

I've written code to handle this special case

Issue tracker

Created the issue directly on GitHub

HTT

  • Check out the code changes
  • Login as user admin and create a content type with a "long" name (21 chars or more), then assign an image field following convention " image" so machine name would be field_<content_type_name>_image, create a new node based on that content type including uploading an image.
  • Notice it doesn't work, hero image won't load
  • Checkout to this branch
  • On the content type you just created, if you add an image field that has the word "image" in its machine name (you can even re-use one of the image fields established for the default content types) and is an image field, the hero image will load.

Documentation

  • This item is added to the release notes
  • This item is documented on LGOS
  • This item has been added to the feature overview

@jaapjan jaapjan changed the title Feature/2944419 #2944419 - Hero images for custom content types when machine name is too long Feb 13, 2018
@jaapjan jaapjan self-assigned this Feb 13, 2018
@jaapjan jaapjan added team: external This PR originates from an external contributor type: feature Adds a new feature to Open Social labels Feb 13, 2018
@jaapjan jaapjan added this to the 1.10 Release milestone Feb 13, 2018
@jaapjan jaapjan merged commit 6058283 into 8.x-1.x Feb 14, 2018
@jaapjan jaapjan deleted the feature/2944419 branch February 14, 2018 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: external This PR originates from an external contributor type: feature Adds a new feature to Open Social
2 participants