Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2015 at 22:25 UTC
Updated:
18 Feb 2015 at 10:24 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #1
geertvd commentedComment #2
idebr commented@geertvd The patch applies cleanly and solves the odd/even classes being added to tables without odd/even classes. However, I think the tabledrag functionality would perform better if it could skip calling the rewriteTable() function altogether. This could be achieved by exposing the setting as an attribute on the table and skip the function calls for tables with the setting. I'll work on a patch for this approach.
Comment #3
idebr commentedAttached patch exposes the no-striping option on the table and adds a new setting 'noStriping' in tabledrag.js. This prevents the restripeTable() from being called.
Comment #4
idebr commentedComment #6
geertvd commentedI was thinking to fix this in the same approach but didn't since
no_stripingis actually a setting on a row rather then on a table.Honestly I can't think of a use case where putting this setting on a row and not on the entire table would be useful though.
In any case at the moment there's no guarantee that
$variables['no_striping']is going to exist which will lead to undefined index notices.Comment #7
geertvd commented#1959110: theme_table outputs the no_striping option as an HTML attribute (followups) is an interesting thread on this.
Comment #8
idebr commentedInteresting indeed. I did some digging to see why this is added on the row instead of the table and found #616240: Make Field UI screens extensible from contrib - part II:
The selector in tabledrag.js as well the table generation in #theme => table currently makes no such distinction, so it seems safe to remove striping from the table altogether in this case:

The updated patch should fix the failing tests.
Comment #9
geertvd commentedNew patch fixes the undefined index notices and fixes the issue.
I also agree with removing the striping on a table level rather then a row level.
Comment #10
alexpottLet's make this
strippingsince this works better logically. If stripping is set to true then we need to restripe the table. Yes I know this is different to theno_stripingbut two wrongs don't make a right :)Comment #11
geertvd commentedComment #12
geertvd commentedComment #13
idebr commentedThanks for picking this up, geertvd.
This could also be written as
empty(($variables['no_striping'])to make it more readable.The other changes look good, thank you:)
Comment #14
geertvd commentedTrue, I thought I tried that first but found a use-case where this would not work. Must be getting tired :)
Comment #15
idebr commentedRe: alexpott #10
I suppose alexpott ment striping instead of stripping. The patch in #14 addresses this feedback, so back to RTBC.
Comment #16
alexpottI did mean striping :) This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 8e19910 and pushed to 8.0.x. Thanks!