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.
When I create a field as list(numeric) and i put there a zero it wont display the label when editing a node.
Comment | File | Size | Author |
---|---|---|---|
#28 | drupalcore-zero_label-866292-27.patch | 3.02 KB | ygerasimov |
#27 | zero_label-866292-27.patch | 3.02 KB | quicksketch |
#24 | zero_label-866292-24.patch | 3.08 KB | quicksketch |
#22 | 0-not-be-used-as-label-866292_test_and_patch-22.patch | 3.02 KB | marcingy |
#19 | 0-not-be-used-as-label-866292_test_only.patch | 2.56 KB | marcingy |
Comments
Comment #1
furamag CreditAttribution: furamag commentedThis is bug in includes/form.inc file. We should fix function theme_form_element_label. We need to replace
to
Comment #2
yched CreditAttribution: yched commentedPushing to form component. There's not much we can do at the Field API level.
Comment #3
yched CreditAttribution: yched commented@furamag: that fix sounds correct. Care to roll a patch ?
Comment #4
yched CreditAttribution: yched commentedOops, posted in the middle of changing the title
Comment #5
ygerasimov CreditAttribution: ygerasimov commentedI would change the condition to
(empty($element['#title']) && ($element['#title'] != 0) && empty($element['#required']))
as if somehow NULL value will come it also should be excluded.
Please review the patch.
What is worrying me more is rendering the field afterwards. Looks like drupal_render() not rendering properly
array('#markup' => 0)
. Please recheck setting the value of the field to zero and look at node view page.Comment #6
ygerasimov CreditAttribution: ygerasimov commentedchanging status to 'needs review'
Comment #7
furamag CreditAttribution: furamag commentedTested for Drupal7-Beta1. It works fine for latest version of Drupal 7. I manually changed includes/form.inc to fix this bug. But we need to change something in this patch to apply it automatically for Drupal7-Beta1.
Comment #8
marcingy CreditAttribution: marcingy commentedBumping to d8
Comment #9
marcingy CreditAttribution: marcingy commented#6: 866292-5.patch queued for re-testing.
Comment #11
marcingy CreditAttribution: marcingy commentedJust a re-roll of patch that was rtbc.
Comment #12
attiks CreditAttribution: attiks commentedI added a test to check if the label is rendered, be warned this is my first test for core
Comment #13
attiks CreditAttribution: attiks commentedRTBC, because my patch only added a test, original patch is working
Comment #14
aspilicious CreditAttribution: aspilicious commentedYou can't mark your own patch rtbc. It would be better if we had a test only patch so we could see it is failing.
(I don't say something is wrong with your patch)
Comment #15
attiks CreditAttribution: attiks commented@aspilicious you're right, but since patch + test is small, I'll just change the status.
Can you mark it as RTBC, if it's checks out?
Comment #16
aspilicious CreditAttribution: aspilicious commentedIf you upload a test only patch I can rtbc it.
Comment #17
marcingy CreditAttribution: marcingy commentedThere are some issues with the patch as is. There are missing periods at the end of comments lines
And we also add a new radio button
Which isn't used in the tests and also has the wrong name.
Comment #18
marcingy CreditAttribution: marcingy commentedComment #19
marcingy CreditAttribution: marcingy commentedReroll of #12 to fix above and add a test for the radio as checkbox. Also the test should be checking for a t('0') as this is the case of the problem. First patch should fail and second should pass.
Comment #20
attiks CreditAttribution: attiks commented@marcingy thanks you're absolutely right, if think I didn't had enough coffee this morning, patch applies cleanly and does what it's supposed todo, so I guess RTBC
Comment #21
sunThe added condition somehow conflicts with the first, ultimately very hard to understand. Use the following subcondition instead:
20 days to next Drupal core point release.
Comment #22
marcingy CreditAttribution: marcingy commentedReroll taking into account #21
Comment #23
attiks CreditAttribution: attiks commentedLooks better and is indeed more readable
Comment #24
quicksketchThis cropped up in the Webform queue today: #1363788: Zero integers not exported in CSV/Exel downloads..
Reroll for the core directory move.
Comment #25
sunThanks!
Comment #26
catchLooks good to me. Committed/pushed to 8.x. Moving to 7.x.
Comment #27
quicksketchReroll for D7. Exact patch, no changes needed other than removing the /core directory.
Comment #28
ygerasimov CreditAttribution: ygerasimov commentedRerolled patch to 7.x
Comment #29
quicksketchHaha, well I'm guessing that I can RTBC @ygerasimov's #28. :)
Solved the problem in Webform that I was experiencing. It's a little bit weird that we're bothering to translate "0", but since this was already committed to D8 and we don't translate tests anyway, I don't think there's any need to hold this up.
Comment #30
webchickOh, silly PHP. :P
Committed and pushed to 7.x. Thanks!
Comment #32
cweagansUpdating tags per http://drupal.org/node/1517250