Coming from #1847596-142: Remove Taxonomy term reference field in favor of Entity reference, it seems that usability will be improved if we move the field cardinality setting below the ones provided by the field module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amateescu’s picture

Status: Active » Needs review
FileSize
1.07 KB

We can either do this or move that whole piece of code up a few lines above in the function. I chose the small patch for now because it seems to have the least chances of conflicting with other field api patches.

xjm’s picture

FileSize
59.54 KB
46.59 KB
31.39 KB
28.67 KB
49.79 KB
26.55 KB
36.07 KB

Here's some screenshots of this patch applied with various field types in HEAD. Overall I think this is an improvement.

Term reference

term_ref.png

Longtext

body.png

Image

image.png

Date

date.png

Entity reference

er.png

File

file.png

List

list.png

tstoeckler’s picture

I won't fight it (anymore than this comment), but I think it's a WTF to declare weights for form elements that you have just declared. I would prefer the code simply be moved appropriately. To my mind weights serve two distinct use-cases:
1. General defaults, not specific to the form, such as adding a weight of 10 to submit buttons. (I don't think we actually do that currently, at least not consistently, but it's something that IMO would make sense.) Or, for easier altering add weights in steps of 10 to all form elements in the order of declaration.
2. Adding form elements at a specific place between other elements in a form alter.
Having the form elements come out in a different order than they are declared in (in the same function) is strange to me.

amateescu’s picture

FileSize
1.89 KB

Re #3: I totally agree that what I did in #1 is not clean at all, I just chose this to way to reduce the potential for conflicts. We can also say that we don't care about that and do it properly :)

Regarding weights for form elements that were just declared, I actually think that's a very useful thing to do. Consider this following scenario:
- Module A wants to alter this form and insert 6 elements between the field cardinality element and field settings container. We can't rely on contrib for playing nice and using a container wrapper, so let's say it sets the weight of the field settings to 10 and inserts its elements in between.
- Module B also wants to alter this form, but has only one element to intert there, so it sets the weight of the fields settings to 5, overring what module A already did.

In conclusion, my impression is that a little babysitting in this case is not the wrong thing to do, so I moved the code in the natural form order but kept the weight of -10. Screenshots in #2 are still accurate.

tstoeckler’s picture

I agree 100%. What I tried to say in #3 was that I find it very strange to use weights that do *not* follow the order of declaration. I think we should accept the possibility of patch conflicts in this case.

amateescu’s picture

Ups, this means I misread what you said (quite possible that early in the morning), sorry for over-commenting then :P

tstoeckler’s picture

No harm done, just wanted to say that I like the patch in #4. :-)

yoroy’s picture

Status: Needs review » Needs work

+1 On moving the 'type' select into first place.

Based on what I see in the screenshots for Image, File and List, it looks like the 'Number of values' select should come second, before all the other nitty-gritty. It would make these forms more consistent across the board.

Dave Reid’s picture

One downside to moving these to up top, is that once the fields have data, you cannot adjust some of those settings at all.

yoroy’s picture

But how is that a downside? (And how does that measure up to getting the first-time setup UX in order? :-)

xjm’s picture

#9 is already the case for all fields on this form. (It's the fields settings form, not the instance settings.) So, I don't see how this patch affects that at all.

yoroy’s picture

FileSize
275.64 KB

I meant to suggest this:

Disregard if that is not in scope for this issue.

xjm’s picture

So @yched said he wants it to be one or the other--either always above, or always below, for consistency. From the screenshots I think the weight below is better most of the time, since the field-specific settings are generally going to be more interesting to the user.

xjm’s picture

Status: Needs work » Needs review

Setting back to NR for that.

yoroy’s picture

i dont understand what 'the weight below' means. my suggestion was:

1. type
2. number of values
3. other...

since the screenshots for image, file & list suggest there is no 'type', i propose to do

1. number of values
2. other...

that's consistent, no?

xjm’s picture

@yoroy, sorry, I meant the number of values. Not sure why I typed "weight".

The number of values is a generic field API setting. Everything else is provided by the particular field type. Therefore, according to @yched, the number of values should either always be above the specific settings, or always below them.

jibran’s picture

Issue tags: -Usability

#4: 1953770-4.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1953770-4.patch, failed testing.

amateescu’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
2.63 KB

So.. are we going to do this or not? :)

swentel’s picture

Status: Needs review » Reviewed & tested by the community

yes!

swentel’s picture

yes!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update, +Needs screenshots

I think the issue summary suggests we doing what the opposite of the patch actually does. It would nice to have a screenshot showing the affect of the patch.

We also need to justify why a normal task should be committed under #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase? - I think the usability provision should cover it.

amateescu’s picture

@alexpott, nope, we're doing exactly what the IS says and the screenshots from #2 are still accurate :)

alexpott’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs issue summary update, -Needs screenshots

Oh okay it's just that #12 and the responses to that comment makes it difficult to grok

yoroy’s picture

Only local images are allowed.

I was confused at first too. It's an improvement because some field specifics will be required items, which are good to show before the optional 'allowed values' which provides a sensible default for most cases (one).

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal task that will improve usability and the disruption it introduces is limited. Per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase?, this is a good change to complete during the Drupal 8 beta phase. Committed 6061967 and pushed to 8.0.x. Thanks!

  • alexpott committed 6061967 on
    Issue #1953770 by amateescu: Move the field-specific settings form...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.