Just creating a separate issue for a backport of #806982: Tables should take an optional footer variable and produce <tfoot>
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | interdiff.txt | 1.2 KB | pol |
| #36 | 1892654.patch | 6.77 KB | pol |
Just creating a separate issue for a backport of #806982: Tables should take an optional footer variable and produce <tfoot>
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | interdiff.txt | 1.2 KB | pol |
| #36 | 1892654.patch | 6.77 KB | pol |
Comments
Comment #1
willvincent commentedHere's a properly formed patch based on miqmago's malformed patch from http://drupal.org/node/806982#comment-6890454 (file paths are based on D8 directory structure in the patch).
Comment #2
willvincent commentedComment #3
marcingy commentedThe d8 version needs to be committed first. Once that happens d7 patch needs to be attatched to that issue.
Comment #4
joseph.olstadD8 patch was committed, Pol has an updated patch in that issue, copy that patch here as this is the new policy.
Comment #5
joseph.olstadComment #6
polHere's the patch.
Comment #8
polHere's the updated patch.
Comment #9
polHere's a better patch with an improved coding style.
Comment #11
polNew patch, including tests.
Comment #12
polComment #13
joseph.olstadIt's already in D8, passes tests, has test, looks good.
Although I've never actually had to use this yet, others are.
Comment #14
joseph.olstadBumping to 7.70, this didn't make it into 7.60
Comment #15
apotek commentedJust re-rolling the excellent patch from @Pol at comment #11 to match current state of drupal 7 (7.63) as the old patch no longer applies.
Endless rework of good work while waiting for the merge to master.
Comment #17
polThe patch still apply on my side, without any troubles.
Comment #18
polUpdating credits.
Comment #19
polComment #20
polComment #21
polComment #22
fabianx commentedI'd like a little restructuring here:
That will simplify the code and make it easier to ready.
---
I delayed committing that as the changes looked massive, but it was overall just structure changes, which is okay this time, but next time let's please do cleanup separate from feature development as it makes things harder to review than necessary.
Comment #23
polHi Fabian,
Thanks for replying.
We cannot do the change you requested.
The
$sectionsvariable is a mapping of keys from$variablesarray into their respective HTML tags and they are processed using the same mechanism, this is why this is abstracted into this variable, to avoid code duplication.rows=><tbody>footer=><tfoot>If we implement your logic, we won't be able to map the
$rowsto<tbody>tag and$footerto<tfoot>tag.Comment #24
polAfter a discussion in IRC, I got the Fabian's point.
Here's an updated patch and the interdiff.
Comment #25
fabianx commentedMy bad - we need to check for !empty() like before to populate 'rows' in sections.
Is there a reason for moving the no_striping out of the `!empty($cells)`?
Looks wrong - or rather needs a justification before that can go in.
The nice thing about this new approach is that the indentation almost remains the same, which makes this much simpler to review than before :D.
Comment #26
polUpdated patch.
I moved back the
no_strippinglogic into the condition as it was before.Comment #27
polUpdating credits - adding Fabian.
Comment #28
fabianx commentedShould be !empty($rows) as that is the weird header / rows structure.
This change is problematic because it changes the current behaviour.
What would work for me is to keep the code as-is, but initialize the $no_stripiing once before the for loop if the tag is tfoot.
That would change the default just once.
This move is unnecessary.
Comment #29
polThanks, updating the patch, interdiff provided.
Comment #30
fabianx commentedLet's not remove the else - the additional line is fine though.
Comment #31
polUpdating patch.
Comment #32
fabianx commentedI think it might be good to say that no_striping defaults to FALSE for 'rows' and TRUE for 'footer'.
Let's do this differently and put:
$default_no_striping = ($tag === 'tfoot');Then use $default_no_striping both in the ternary operator as well as in the else block.
Comment #33
polComment #34
fabianx commentedjust nits remaining!
Looks very great already :).
s/stripping/striping/
This is no longer needed as it's unused.
I think we can change that to '// Format the table rows and footer'
Comment #35
polForget this one, I forgot to fix a typo.
Comment #36
polComment #38
fabianx commentedRTBC - let's get that in
Comment #40
polThanks all!
Comment #41
joseph.olstadNice work! Thanks!
Merci Pol
Dankeschön FabianX