Closed (fixed)
Project:
TableField
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Aug 2011 at 08:39 UTC
Updated:
12 Sep 2016 at 06:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Everett Zufelt commentedI have not used this module, but I do think it would be useful for the ability to add a table caption to be introduced.
Regarding alt / longdesc, these really only apply to images. If you can give more details about how you envision these being introduced to this module I can provide some feedback.
Comment #2
simon georges commentedHmmm, sorry, the longdesc is for images, for tables it's "summary".
I was thinking about adding one text field for the caption, and a textarea for the summary, both not mandatory, and, if present, rendered by the formatter (eventually prepare a formatter with / without caption).
I've not studied the hook for D7 yet, so I don't know if you have to alter at the field and/or widget level. I'll take a look at this when I have some time.
Comment #3
lsolesen commented@Simon Georges --> you ever got around to having a look at this issue?
Comment #4
simon georges commented@Isolesen, my client didn't need it, so I (shame on me) didn't do anything on the subject :-(
Comment #5
btopro commentedThis patch resolves 3 accessibility errors currently with this module.
All three of these improve screenreader support and are requirements of major accessibility standards.
This is rolled against the latest git checkout / dev. Please review this patch and get this pushed through with some priority as accessibility of this module is a major blocker for government and university usage.
Comment #6
btopro commentedOops, realized I did a checkout of master and not 7.x-2.x for initial patch. This one is rerolled against 7.x-2.x
Comment #7
ItangSanjana commented#6 patched.
tablefield_accessibility-1251738-6.patch:40: trailing whitespace.Everything else OK. TIA
Comment #8
ItangSanjana commented#6 patch.
Invalid argument supplied for foreach() in theme_tablefield_view() (line 872 of /sites/all/modules/tablefield/tablefield.module).Steps to reproduce:
Leave the header empty and save the node.
Comment #9
zerobyte commented@iS, does the bug you're referring to only apply if the table header is left empty?
Comment #10
ItangSanjana commented@zerobyte, yes it does. Not empty no problem.
Comment #11
mastoll commentedYikes.
Any resolution on this? It would be nice to be able to leave the headers empty.
Comment #12
btopro commentedHow do you make a table without headings using this? Isn't that just an empty table?
Comment #13
mastoll commented@btopro, if I understand your question correctly, you leave the first row blank, fill in the rest of the rows.
Comment #14
mgiffordThere are now examples in D8 Core of how to do this.
Comment #15
ItangSanjana commentedHi, this patch fixed #8 issue. Please review.
Comment #16
btopro commentedLooks fine to me; only difference from #8 is checking for the header property prior to looping through instead of the other way around; this should resolve the issue expressed with #8
Comment #17
mgiffordSummary has been depreciated, worth checking out #843708: Add option to set caption & remove summary in the html table (Accessibility). Changing title.
Comment #18
sjbassett commentedGreat to see this change being added to this module. I wanted to suggest some changes that needs a bit of review. The changes involve better descriptions for the accessibility fields added to the widget.
See the new Patch #18
Comment #19
btopro commented@sjbassett can you rework the patch based on what @mgifford said in #17 . Summary is no longer a thing from my reading so we shouldn't keep pushing it in A11Y patches. Caption should be good enough for making the table accessible. Aria I assume can be added via other projects / themes if people want to add even more detail.
Comment #20
sjbassett commented@btopro Good to hear that we are removing summary, it isn't very helpful. I will just remove that then and reroll the patch in a second.
Comment #21
sjbassett commentedSo I am guessing that we would want to use something similar to this type of markup to provide better semantic for describing the data:
Comment #22
sjbassett commentedThe browser support for the details element is pretty lousy, see MDN Browerser Support for
<details>element.I think a simple addition of the caption field would be the best solution for this module, less changes and flexible enough to add further changes in the future.
Comment #23
sjbassett commentedSimplified the patch to include just the caption element since browser support is great for the
<details>element, changing the title to "Allow ability to set table caption"Comment #24
btopro commentedLooks good aside from small typo in comments
+ // check for table captionwq. Got any testers to push this forward?Comment #25
mgiffordSo yes, Details look bad but they seem to basically work fine in D8.
SUMMARY is obsolete in HTML5 and this is the recommendation for making accessible tables Section 4.9.1.1 Techniques for describing tables
Other sources:
Comment #26
sjbassett commented@mgifford
I am in full support of using new elements to help improve the semantics here, but for a bit of pragmatism, I think we should make a solid change just for caption, then add a new issue on handling the nested details within the caption.
Comment #27
mgiffordYup,
<caption>is solid.Comment #28
sjbassett commentedComment #29
liam morlandComment #30
mgiffordSome overlap...
Comment #31
gremy commentedRe-rolled the patch so that it applies cleanly on the latest version of tablefield.
Comment #32
jenlamptonThis new version of the patch fixes some PHP syntax errors, capitalization, and spacing.
Also, I cleaned up the text on the Caption field. Before the label was Caption and the description was
Provide a brief description of the data the table contains, this is associated to the table and helps Assitive Technology, like screen readers, better describe your tables content..Now, the label is Table description and the description is
This brief caption will be associated with the table and will help Assitive Technology, like screen readers, better describe the content within.Comment #33
jenlamptonRerolled again with a little more cleanup and to prevent another PHP notice.
Comment #34
kmcculloch commentedThe patch at #33 passes a "caption" argument to theme_table whether the user provided a caption or not. If the user didn't enter a value this results in an empty caption tag in the markup. I refactored theme_tablefield_view() to prevent this.
This patch was generated against commit 90f2bd5 in the 7.x-2.x-dev branch.
Comment #35
jenlamptonThis looks great now, thanks for the improvement @kmcculloch!
Comment #37
jenlamptonThis feature will be in the next release.
Comment #39
jenlamptonWhoops, it looks like this actually contains a little XSS hole. Let's see if I can fix it up real quick.
Comment #42
jenlamptonI added two calls to
check_plain()where the caption was passed into the theme layer, and where it was displayed in the form. If the caption needs to contain markup (or something other than plain text) let's open a follow-up issue. I think this is a great improvement to have the table caption, so I'd like to get this into the next release. Marking fixed.