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.

Comments

chrismiller627’s picture

StatusFileSize
new682 bytes

This patch should take care of the issue.

chrismiller627’s picture

Status: Active » Needs review
Issue tags: +Needs manual testing
pameeela’s picture

StatusFileSize
new198.41 KB
new347.98 KB

I've tested this patch manually and it works. Screenshots attached.

Steps:

  1. Apply patch
  2. go to manage the image field in an article content type (admin/structure/types/manage/article/fields/field_image)
  3. Check: Enable Alt Field, Alt Field Required, Enable Title field. Leave "Title Field Required" unchecked.
  4. Save Settings
  5. Goto node/add/article
  6. Enter value into title.
  7. In Image Field, Choose File and click Upload. Alternative Text & Title fields appear.
  8. Enter value into Alternative Text field, leave Title field blank.
  9. Click Save & Publish.
  10. Node saves successfully

image-settings.png

empty-title.png

vegantriathlete’s picture

The code has changed. I have rolled a new patch and tested it.

claudiu.cristea’s picture

Status: Needs review » Closed (duplicate)

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

claudiu.cristea’s picture

Issue summary: View changes

Update the solution a bit.