Support from Acquia helps fund testing for Drupal Acquia logo

Comments

droplet’s picture

how can i reproduce this error

Peter Törnstrand’s picture

Have the same error on my install.

In my case the table contains unlimited number of nodereference fields (Autocomplete widget) and from the screenshot above it seems mfer is using unlimited media fields (Media file selector widget).

The offending CSS is in field.css

form .field-multiple-table th.field-label {
    padding-left: 0;
}
jensimmons’s picture

Title: Labels in tables misplaced. » Labels in tables need some left padding

a screenshot of the visual bug

I agree, there should be some padding on the left of these labels. This code fixes the problem.

form .field-multiple-table th.field-label {
    padding-left: 6px;
}

a screenshot of the bug fixed

Meanwhile, I've been getting around this bug by creating an custom administration theme that's a child of Seven, and putting this code into that child theme.

jensimmons’s picture

Status: Active » Needs review
FileSize
378 bytes

Ok, here's a patch with that change.

Bojhan’s picture

Is this a bug only experienced in contrib? I never saw it in core, and cant find a place to reproduce it.

Bojhan’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7
jensimmons’s picture

This is in core. It's been there for a long time. It's a bug in the Seven theme — one that you will see even with a brand new install and nothing downloaded from contrib.

How to reproduce:
1) Create a multivalue field in any content type. (Doesn't matter what kind of field).
2) Go to enter content for that content type.
3) Look at the table header for the multivalue field form. :(

jensimmons’s picture

Actually, this code looks better and I believe is closer to what was originally intended.

form .field-multiple-table th.field-label {
    padding-left: 10px;
    padding-top: 4px;
}

how it looks now

jensimmons’s picture

A patch with the code from comment 8. I hope.

Status: Needs review » Needs work

The last submitted patch, Seventablelabelpadding-1038356-9.patch, failed testing.

rjgoldsborough’s picture

Status: Needs work » Needs review
FileSize
401 bytes

Re-rolled patch.

xjm’s picture

Status: Needs review » Needs work
Issue tags: +Novice

The proposed change looks good to me. Note that the Drupal 8.x patch will need to be rerolled, because the core directory structure for Drupal 8 has now changed. (For more information, see #22336: Move all core Drupal files under a /core folder to improve usability and upgrades). When the patch has been rerolled, please set the issue back to "Needs Review."

Tagging as novice for the task of rerolling the Drupal 8.x patch.

If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.

rjgoldsborough’s picture

Status: Needs work » Needs review
FileSize
421 bytes

Rerolled due to file structure change.

droplet’s picture

remove styles, keep it same as other TH head
TH head

xjm’s picture

#14 is interesting; I wonder why that CSS was there to begin with? Are we altering the rendering of anything else by making this change?

droplet’s picture

I guess it had padding-left on LABEL

<th class="field-label" colspan="2"><label>test: </label></th>

ezheidtmann’s picture

I have reviewed this patch and I can confirm that the latest 8.x patch fixes this bug as droplet describes. It also fixes the identical problem in Bartik. (should the component be changed to field system or CSS?)

The line in field.css was added 3 years ago in what appears to be an unrelated commit:
http://drupalcode.org/project/drupal.git/commit/4ac090eb54ecc7ad5bf5df42...

To answer the question "Are we altering the rendering of anything else by making this change?": No. The CSS selector includes the class "field-multiple-table" and this string occurs just once in core outside of the css files this patch touches: in core/modules/field/field.form.inc where tables are generated for multi-value fields.

Status: Needs review » Needs work

The last submitted patch, 1038356-seven-table-th-label-D7.patch, failed testing.

xjm’s picture

Component: Seven theme » CSS
Status: Needs work » Needs review
Issue tags: +Needs manual testing

Thanks @ezheidtmann! We should probably double-check this fix looks correct in:

  • Core themes
  • Supported browsers
  • RTL
August1914’s picture

Checked D8 before the patch to verify I could see the reported problem; then ran the D8 patch and verified that it sets padding acceptably for the label of multi-value fields, as seen under Firefox, Safari and Chrome, under Seven and Bartik; checked RTL as well. (I wasn't able to get a test site to where I could get at it from IE.) Looks good.

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community
August1914’s picture

Verified also under IE8 as well.

catch’s picture

Version: 8.x-dev » 7.x-dev

Thanks! Committed/pushed to 8.x, there's a 7.x patch here already so leaving RTBC.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
12.26 KB
12.26 KB

I tried the Drupal 7 patch in Garland and it didn't look good:

Before:

garland-before-patch.png

After:

garland-after-patch.png

So, it introduces a misalignment in the field label where there wasn't one before.

Not sure what to do about that, because overall the patch does make sense.

I think the issue is that Garland is doing some weird stuff with its table layouts (in fact, if the original change was made 3 years ago as described above, I think that was back when Garland was still the default theme so maybe it was done to "fix" Garland)... So, we could leave the change as is and then do something else to fix Garland, but that also makes me wonder if there are other themes out there that this generic fix will break.

Moving back to "needs review" since it seems we need a little more thought on how to handle this for Drupal 7.

geerlingguy’s picture

Assigned: Unassigned » geerlingguy

Going to take a quick glance at this during a meetup tonight as an example.

geerlingguy’s picture

Status: Needs review » Needs work

It does seem a little wonky in Garland, but should we fix that with some theme-specific CSS, or should we leave it be?

In my testing, I found the exact same thing happened as David_Rothstein.

geerlingguy’s picture

Assigned: geerlingguy » Unassigned
R13ose’s picture

Issue summary: View changes
Status: Needs work » Needs review

I tried the patch in #14 (1038356-seven-table-th-label.patch) in Drupal 7.42-dev and I like the padding that is given in the label. I tested this in themes (Seven, and Bartik), Firefox and Chrome, and the RTL language Arabic which works for me too.

abinayaa.k’s picture

Hi,
I have checked this issue in drupal7. Its working fine.

sandipauti’s picture

Add padding to your table form field i.e

form .field-multiple-table th.field-label {
padding-left: 0;
}

Add this CSS to active theme file.

Cheers,

  • catch committed f272a6b on 8.3.x
    Issue #1038356 by jensimmons, rjgoldsborough, droplet: Fixed labels in...

  • catch committed f272a6b on 8.3.x
    Issue #1038356 by jensimmons, rjgoldsborough, droplet: Fixed labels in...
imshivani’s picture

FileSize
30.25 KB
6.54 KB

Steps I followed to test the patch #14:
1) I installed the Drupal 7.52-dev.
2) Then I saw the issue in the labels of the table.
3) I downloaded the patch #14 and applied it in the Bartik theme.
4) I checked the patch for firefox and chrome and it is working fine for the both.
I'm attaching the screenshots of before and after applying the patch.

  • catch committed f272a6b on 8.4.x
    Issue #1038356 by jensimmons, rjgoldsborough, droplet: Fixed labels in...

  • catch committed f272a6b on 8.4.x
    Issue #1038356 by jensimmons, rjgoldsborough, droplet: Fixed labels in...
mahalingam_cs’s picture

Applied the patch successfully in Seven 7.55-dev and Stark 7.55-dev ( Drupal 7.x) and the labels alignment looks good.

jollysolutions’s picture

Status: Needs review » Reviewed & tested by the community
David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs work

This is the same patch as before, and it has the same problem that I identified previously in #24.

  • catch committed f272a6b on 9.1.x
    Issue #1038356 by jensimmons, rjgoldsborough, droplet: Fixed labels in...