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.
If one uses the profile module to make a list selection box that contains numbers, if the first number in the list is a zero, it will not appear as a selection. (however, listing the number as <0>, works)
Comment | File | Size | Author |
---|---|---|---|
#19 | fix-display-0-131560-17.patch | 1.47 KB | Alex Savin |
#16 | value-0-for-profile-field-131560-16.patch | 3.26 KB | Alex Savin |
#13 | value-0-for-profile-field-131560-13.patch | 3.26 KB | Alex Savin |
#10 | profile.patch | 1.21 KB | Alex Savin |
Comments
Comment #1
tostinni CreditAttribution: tostinni commentedIn fact this a little worse than that, it doesn't accept 0 at all.
The problem is in code like this:
When line equal 0, we have if (0) which is FALSE so this value is omitted. Should we write:
I'm not sure on how to correct this (with clean code I mean).
Comment #2
joep.hendrix CreditAttribution: joep.hendrix commentedThe same problem if you want to accept an empty string.
I want the first line to accept an empty string. This is specially usefull for required fields.
I want the user to select a value when it is a required field. Now the first value is automatically selected which is not correct.
Comment #3
LAsan CreditAttribution: LAsan commentedAny news about this?
Comment #4
clarkburbidge CreditAttribution: clarkburbidge commentedI have just run into this issue on 6.8 using the profiles module. I need to have the number zero be an option for a select list. When I go to the user profile, the zero is not an option and the options in the select list starts with the number 1.
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis looks like a confirmed bug. Any solution will need to go in 7.x first, before being backported to any other affected versions.
Comment #7
dawehnerwhat about a wrapper called
or just call trim with the changed charlist, but i guess there a quite some places, where "0" should be displayed too
Comment #8
sun.core CreditAttribution: sun.core commentedThat faulty status made each and everyone skip this issue.
Comment #9
Alex Savin CreditAttribution: Alex Savin commentedI ran into this bug too and I think it should be a critical one because it really takes you the ability to insert values into a certain profile field. The problem occurs even if the type of field is textfield.
Comment #10
Alex Savin CreditAttribution: Alex Savin commentedFor me at least, the attached patch did the job.
Comment #11
Alex Savin CreditAttribution: Alex Savin commentedI will have to correct this comment. It does insert the value "0" in the data base but it doesn't show it in any views because in the IF statement it's value is just passed like:
instead of
Comment #13
Alex Savin CreditAttribution: Alex Savin commentedThis should do the work hopefully.
Comment #14
Alex Savin CreditAttribution: Alex Savin commentedComment #15
Alex Savin CreditAttribution: Alex Savin commentedComment #16
Alex Savin CreditAttribution: Alex Savin commentedSorry for the repeated status changes and patch attach but I think now it is better.
Comment #17
thedavidmeister CreditAttribution: thedavidmeister commentedAs per #5, any fix needs to go in the latest version of Drupal affected and then back-ported from there.
Comment #18
mgifford@thedavidmeister - any reason you didn't set this to 8.x?
Comment #19
Alex Savin CreditAttribution: Alex Savin commented@thedavidmeister I attached a rough patch for D7. If it passes the tests it should work fine.
Comment #20
dcam CreditAttribution: dcam commented@mgifford
Profile was deprecated in 7.x and only included as an upgrade path from 6.x. It was removed in 8.x See https://www.drupal.org/node/874026.
Comment #21
dcam CreditAttribution: dcam commentedI didn't notice that the last patch wasn't tested. Setting status.
Comment #22
mgiffordGood to know, thanks!
Comment #23
thedavidmeister CreditAttribution: thedavidmeister commented@dcam is correct. There is no profile module in d8.
Comment #24
cilefen CreditAttribution: cilefen commentedI tried but I can't reproduce this on 7.x-dev as I understand it. Could someone update the issue summary with the steps to reproduce this on Drupal 7? According to the current issue summary there is a workaround, so is this is major priority according to the guide. To be critical it would "Render the system unusable and have no workaround", which is not the case.