Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RainbowArray’s picture

Is there anything we will need to change with this? Are there any situations where we would have provided a srcset with w suffixes without also having a sizes attribute?

attiks’s picture

Two places:

1/ The fallback image is using srcset, so we need to use sizes as well, unless we change the fallback top src, #2481637: Use src in fallback image

2/ If we add the UI, we need to make sizes a mandatory field with a default value of 100vw

attiks’s picture

Mark sizes as required, default change to "100vw" to reflect the specs
Mark image styles as required as well

The last submitted patch, 3: i2481635-3.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 3: i2481635-3.patch, failed testing.

The last submitted patch, 3: i2481635-3.patch, failed testing.

The last submitted patch, 3: i2481635-3.patch, failed testing.

attiks’s picture

Status: Needs work » Needs review
FileSize
1.94 KB

Moved the required to the states, so it works.

Jelle_S’s picture

Status: Needs review » Reviewed & tested by the community

Works great, thanks.

RainbowArray’s picture

Status: Reviewed & tested by the community » Needs work

Manually tested this.

If sizes is selected, and you leave an empty sizes attribute, you are immediately prompted to enter a value for that attribute.

However, if you have a value in the sizes attribute, but don't select any image styles, then save, you get a message that the image style has saved, but you aren't returned to the list of image styles. If you then open up the breakpoint options, sizes is no longer selected. So that's confusing.

While there is a required indicator next to every image style (which is confusing: am I supposed to check every image style?), there is nothing that happens if you don't select at least one.

Some sort of onscreen validation on save would be nice, as well as a less confusing indictor for what is required.

attiks’s picture

Assigned: Unassigned » attiks

#10 Strange, I'll have another look

attiks’s picture

Status: Needs work » Needs review
FileSize
2.98 KB
1.23 KB

Validation added, the checkboxes after each image style is another bug, so I left it, if needed we can remove it.

attiks’s picture

Adding related issues for the #states problem:

#1017882: Required elements buggy with #states was supposed to fix it, but is only for D7
#1239930: states.js appends span.form-required to every label of a dependent field has a working patch and I marked it RTBC

Jelle_S’s picture

RE #10: Wow. I totally missed that. Good to have an other pair of eyes :-)

Jelle_S’s picture

Status: Needs review » Reviewed & tested by the community

Besides the states.js stuff (which is out of scope for this issue anyway) it all seems to work. So back to RTBC

Only local images are allowed.

RainbowArray’s picture

Manually tested this, works much better now. Thanks!

Slight tweaks to the error messages.

attiks’s picture

Assigned: attiks » Unassigned

#16 Thanks for checking the wording, much better.

attiks’s picture

#16 Thanks for checking the wording, much better.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

I was confused on why we needed to be this fancy when #required = TRUE does the job elsewhere.

Marc explained that sizes is only conditionally required if we're not using an image style, and that when we are using sizes we need at least one image style to act as the srcset value. Fair enough.

Committed and pushed to 8.0.x with small grammar fix. Thanks!

Status: Fixed » Closed (fixed)

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