Problem/Motivation
The problem occurs when you're setting up the title & alternative text field requirements on the image field on the article content type. Currently, the alternative text field will dictate if both the title and alternative text fields are required. the title requirement checkbox is currently non functioning.
1. git pull
2. drush si
3. go to manage the image field in an article content type (admin/structure/types/manage/article/fields/field_image)
4. Check: Enable Alt Field, Alt Field Required, Enable Title field. Leave "Title Field Required" unchecked.
5. Save Settings
6. Goto node/add/article
7. Enter value into title.
8. In Image Field, Choose File and click Upload. Alternative Text & Title fields appear.
9. Enter value into Alternative Text field, leave Title field blank.
10. Click Save & Publish.
Error: The field Title is required.
Proposed resolution
See patch. The title requirement field was correctly being created, this appears to be just be an issue with correctly targeting the validation.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | issue-1913712-image-field-setup.png | 100.8 KB | vegantriathlete |
| #4 | 1913712-image-title-field-required-reproduced.png | 111.85 KB | vegantriathlete |
| #4 | issue-1913712-after-patch-applied.png | 130.1 KB | vegantriathlete |
| #4 | optional_title_reroll-1913712-4.patch | 708 bytes | vegantriathlete |
| #3 | image-settings.png | 347.98 KB | pameeela |
Comments
Comment #1
chrismiller627 commentedThis patch should take care of the issue.
Comment #2
chrismiller627 commentedComment #3
pameeela commentedI've tested this patch manually and it works. Screenshots attached.
Steps:
Comment #4
vegantriathleteThe code has changed. I have rolled a new patch and tested it.
Comment #5
claudiu.cristeaI can confirm this bug. I also discovered this while working at #2072995: Move FAPI callbacks for file/image widgets in classes. I fixed the error there (see patch from #2072995-7: Move FAPI callbacks for file/image widgets in classes). Let's keep that one because it's part of D8 conversion.
Comment #5.0
claudiu.cristeaUpdate the solution a bit.