Closed (fixed)
Project:
Drupal voor Gemeenten
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2016 at 14:52 UTC
Updated:
14 Jul 2016 at 19:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bskibinskiComment #3
askibinski commentedProblem with this patch: there are 3 sections available but you are not required to use them all. However, with this patch you would always need to add three sections with a title.
Comment #4
askibinski commentedChanged title, fix would be to prevent the notice in the first place.
Comment #5
askibinski commentedPatch attached.
Comment #6
tessa bakkerI fought that a required FC-item field can be required if the FC-field itself isn't required.
The problem is, that there are always 3 items printed, instead of 1 or something equal to the used items, with a maximum of 3.
Also with the patch #5, a list item won't be printed and this could be a usability/accessibility issue.
A validation on title is in my opinion the way to go, when the body of the FC-item isn't empty, the title is required.
Or.. there is only one FC-item with an 'Add more' button with a max of 3 and FC-item-title-field is required.
Comment #7
tessa bakkerComment #8
askibinski commented@Tessa: the add more functionality with a max of 3 would be best, in that case the title could be required.
There is a RTBC patch for field_collections to allow for an add more button:
https://www.drupal.org/node/1788222
However, I'm not sure if this patch takes into account a maximum number of items set. Worth testing though!
Comment #9
bskibinskiThe 'add more' doesn't solve the problem of the required title.
Even if there is just one title+body, and the title is required, then you have to fill it, even if you want to leave it empty. So you would always need the "body isset" check.
But on second thought i don't think making it required is the best solution. The customer wanted to make a very short task, and didn't need the extra title, it would just make it confusing to read, so just displaying the text without anchor/title is fine.
I think making it optional is best for now. I don't understand why this is an accessibility issue though?
Comment #10
tessa bakkerIf the customer want to create a very short task, don't use a section.
A section is only needed for complex tasks where headings are needed.
Why titles need to be required is because if you have 2 or more sections, you can skip to section 2 or 3 with the small in-page menu very helpful on small screens like phones). Also this menu can be use to style the sections as tabs on wider screens.
Comment #11
askibinski commentedI've created a follow-up for these improvements: #2757727: Improve sections UX so the patch in #5 can be committed.
Comment #13
ralphvdhoudt commented