Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: http://api.drupal.org/api/drupal/includes!form.inc/function/theme_tables...
Enter a descriptive title (above) relating to theme_tableselect, then describe the problem you have found:
This is missing some ; and ,
Comment | File | Size | Author |
---|---|---|---|
#20 | form-codeexample-1706926-20.patch | 2.12 KB | Ivan Zugec |
#17 | form-codeexample-1706926-17.patch | 2.12 KB | Ivan Zugec |
#15 | form-codeexample-1706926-15.patch | 1.99 KB | Ivan Zugec |
#11 | form-codeexample-1706926-11.patch | 1.91 KB | Ivan Zugec |
#8 | form-codeexample-1706926-8.patch | 1.33 KB | Ivan Zugec |
Comments
Comment #1
joachim CreditAttribution: joachim commentedThe code is also wrong... in that the table produced is empty because there is no #header property.
Perhaps I should remove the Novice tag...?
Comment #2
eddie_c CreditAttribution: eddie_c commentedI am a novice, but I'll have a go ;) How about something like this?
Comment #3
jhodgdonThanks! This is a good start... Someone needs to test the code to verify that it actually works now.
Also, I would prefer to see a code style more like:
(that would be more consistent with what we normally do in Drupal Core).
Please also use the American spelling "color" instead of "colour". And we don't normally leave a space between array and the opening (.
Comment #4
eddie_c CreditAttribution: eddie_c commentedThanks for the review jhodgdon. Here's another patch incorporating your suggestions.
Comment #5
jhodgdonLooks pretty good, formatting-wise anyway... Someone needs to test the code and verify that it works.
Also, doesn't this need a t() on the title and empty text?
Comment #6
Ivan Zugec CreditAttribution: Ivan Zugec commentedI have rerolled the patch with a few updates thanks to jhodgdon and I tested the code.
Comment #7
jhodgdonBetter!
I guess I must not have looked too carefully at the formatting on the previous patch. I think there are a couple of things that need fixing here:
- array(...) should not have a space between array and (
- I think we could do away with all of the blank lines in the code sample. They take up a lot of space and I don't think they add a lot of clarity.
I am also confused about this example. This is a table-select... maybe we could use something that is more realistic? What is this treacle and corkscrew meant to be? I don't even think most people in the world would know what "treacle" is -- I'm not really sure myself. Also, what is the empty text meant to be saying?
Comment #8
Ivan Zugec CreditAttribution: Ivan Zugec commentedThanks for the review jhodgdon. I have implemented the requested changes.
- Fixed up the spacing issue between array and (
- Cleaned up the white spaces
- Made the content a bit more realistic
Comment #9
Ivan Zugec CreditAttribution: Ivan Zugec commentedComment #10
jhodgdonMuch better, thanks! I was about to commit this patch, but I realized it pertains to the @param, so it should be included in the @param instead of where it is now in the main body of the function docs (which doesn't make much sense, since it lacks context).
Comment #11
Ivan Zugec CreditAttribution: Ivan Zugec commentedYes that does make sense. I have moved the
@code
below the@param
.Comment #13
jhodgdon#11: form-codeexample-1706926-11.patch queued for re-testing.
Comment #14
jhodgdonThe blank line between the existing @param text and the new text needs to be removed, and the new text should be wrapped with the previous text. Thanks!
Comment #15
Ivan Zugec CreditAttribution: Ivan Zugec commentedHere's another patch with the requested changes.
Comment #16
jhodgdonThanks! The only thing is, these two lines should be wrapped together:
Comment #17
Ivan Zugec CreditAttribution: Ivan Zugec commentedSorry about that, I have wrapped the text onto a single line:
Comment #18
jhodgdonLooks good! I'll get this committed shortly.
Comment #19
jhodgdonActually, that line needs to be wrapped at 80 characters. It goes over by a few currently.
Comment #20
Ivan Zugec CreditAttribution: Ivan Zugec commentedRe-rolled the patch and wrapped the line at 80 characters.
Comment #21
jhodgdonThis time I think I'll be able to commit it. Thanks!
Comment #22
jhodgdonThanks! Committed to 8.x and 7.x.