this is one of the patches which was part of refactor profile_browse() and cleanup+new small features of profile.module and user.module
there were two ways to fix this - but nothing had to do with the function mentioned
at profile_view_profile()there is the following line:$title = ($field->type != 'checkbox') ? check_plain($field->title) : '';one solution would be to change the '' to NULL.
the ":" which is listed on the user-page does disappear (a common example is http://scratch.drupal.org/user/1 - do you see all the single ":" on every item?)
but then text will be attached to the last item visually (because of the definition-list used)- change "the root of the evil":
--> change theme_user_profile() - that is what I did
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | user.module_43.patch | 2.12 KB | Zen |
| #5 | user.module_42.patch | 1.25 KB | Zen |
| #3 | user.module_41.patch | 2.1 KB | Zen |
| #1 | user.module_40.patch | 826 bytes | Zen |
| usermodule.fixthecolon.patch | 895 bytes | Tobias Maier |
Comments
Comment #1
Zen commentedTobias, I didn't see your patch before.. but I've attached a patch which might do this a little more cleanly.
Ideally, we should change 'checkbox' to 'checkboxes' in profile.module, and use a list to display them - this is kinda ugly, and too labourious (adding in checkboxes one by one).
Please review - thanks :)
-K
Comment #2
Tobias Maier commentedyour right, your patch is better :D
Comment #3
Zen commentedOn second though, I just realised that the !empty will invalidate any title of value '0'. While the current profile module doesn't follow the form->validate->submit model, and invalidates titles with value 0.. they will be valid once the module has been converted.
A title value of 0 for a checkbox is a not so unlikely possibility.
Patch:
\ns, as we don't use it with any degree of consistency to let them remain.As mentioned in my previous post, using a checkboxes item in the profile module (with a title field for the group) should sort this out eventually.
Cheers
-K
Comment #4
Tobias Maier commentedhmm...
your right an empty
<dt>is bad.but the structured information which we get is broken if we don't print a
<dt>. (and it looks ugly - because it gets attached to the last<dt>)because we generate a
<dd>without a<dt>. That means that this<dd>-Element belongs to the last<dt>-Element.Maybe we should print an element without a valid title in a
<div>I prefer the following check
I think we should combine both setting it to NULL and to check if it is empty
t(':')Why? I dont see any need for this.
Just one sql-query more...
Comment #5
Zen commentedThe dd tag will be inside the dl, so there shouldn't be any confusion with the previous dt.
The t() doesn't involve a separate sql query. I've refined it further in the attached patch as per Berkes' suggestion.
Please re-review :)
Thanks
-K
Comment #6
Zen commentedChanging title to be more accurate.
Thanks
-K
Comment #7
Tobias Maier commenteddid you forget the part of the profile.module in this patch?
Comment #8
Zen commentedI did. Thanks :)
-K
Comment #9
Tobias Maier commenteddid we ever something like this this way?
I searched a little bit in drupal core and I found this theme_form_element()
there you can read:
as you can see the ":" is not in a
t()I think this is not really needed -> so remove this part please
because I think then it is ready to go...
Comment #10
Zen commentedThanks for the review Tobias :) But I disagree. This should be translatable. Not all languages might use a colon for punctuation etc. etc. For e.g. in Sanskrit, a full stop/period is usually represented by a | or a || depending on the context. The same might be the case with other punctuation symbols as well. Either way, I suggest that we RTC this and see what happens :D
If it happens elsewhere, they are bugs too :P [grep -Rin "\.':" * | wc -l == 16]
Thanks
-K
Comment #11
Tobias Maier commentedok I understand....
Comment #12
dries commentedCommitted to HEAD. Thanks.
Comment #13
Zen commentedComment #14
(not verified) commented