MyBB Community Forums

Full Version: Format_username function is missing a few things.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Yo,

*Not exactly a bug

format_username function in functions.php DOES not seem to fetch usergroup (the second argument) if not specified.

Please fix.

Good luck Smile
(2015-04-02, 03:05 PM)Cedric Wrote: [ -> ]*Not exactly a bug

Should have been posted in suggestions then, moved there.

Anyways, I don't see any usefulness of this. In the core it's not needed anywhere and in plugins you can always query the usergroup yourself.
The phpdoc comment tells it does fetch the usergroup in that case. Since that's wrong it is actually a bug.
I'd rather call that bad/incorrect documentation - bugs usually concern program's functionality. But yea, the comment should be corrected instead of implementing the code - format_name() is used for guests too so that wouldn't work well with searching database by username.
(2015-04-02, 08:13 PM)Destroy666 Wrote: [ -> ]I'd rather call that bad/incorrect documentation - bugs usually concern program's functionality. But yea, the comment should be corrected instead of implementing the code - format_name() is used for guests too so that wouldn't work well with searching database by username.
It does not matter if it is not useful for you. It is, for me and other devs. Please make sense when you reply Dodgy

(2015-04-03, 01:36 PM)Cedric Wrote: [ -> ]
(2015-04-02, 08:13 PM)Destroy666 Wrote: [ -> ]I'd rather call that bad/incorrect documentation - bugs usually concern program's functionality. But yea, the comment should be corrected instead of implementing the code - format_name() is used for guests too so that wouldn't work well with searching database by username.
It does not matter if it is not useful for you. It is, for me and other devs. Please make sense when you reply Dodgy

" format_name() is used for guests too so that wouldn't work well with searching database by username."


You have got to be kidding me, lol.
(2015-04-03, 01:36 PM)Cedric Wrote: [ -> ]It does not matter if it is not useful for you. It is, for me and other devs. Please make sense when you reply Dodgy

Interesting theory. However, I don't see any other dev asking for it here or in any other topic, do you?

(2015-04-03, 01:36 PM)Cedric Wrote: [ -> ]You have got to be kidding me, lol.

That's a brilliant and mature counterargument... And makes so much sense, which you requested from me above. But even though it's so convincing, I'll rather stick to my opinion.
See dude. I know how it feels, being in power. Believe me, I have been there, trying to be the "All rounder" Toungue
But this only brings disrespect. So, be nice, listen to all and reply in a nicer manner, always. No matter what and everyone will respect you Smile

Anyways back to the topic. I will be glad to see it added.
I don't understand the trouble.

OK, there's an error in the PHP documentation, but all users have an usergroup, even guest (-1).

So, the logical developments are to alway send the usergroup. I can't understant when you can want to ask an username formating without having the group information.
@Cedric, exactly, that's why you shouldn't rush at people with "make sense when you reply" or "you have to be kidding me" posts after they post their a negative opinion about your idea. Using reasonable counterarguments might be a better way to prove your point.

EDIT: @down, yes, I don't and won't see its usefulness - I'd never use it in any code for performance reasons. It's my opinion, which I'm free to post not only as a staff member, and you can have your own.

(2015-04-03, 02:25 PM)Crazycat Wrote: [ -> ]So, the logical developments are to alway send the usergroup.

Yep. Especially that the usergroup argument is currently required by the function: https://github.com/mybb/mybb/blob/featur....php#L2961 so not specifying it at all as stated in the 1st post would even throw an error.
(2015-04-03, 02:44 PM)Destroy666 Wrote: [ -> ]@Cedric, exactly, that's why you shouldn't rush at people with "make sense when you reply" or "you have to be kidding me" posts after they post their a negative opinion about your idea. Using reasonable counterarguments might be a better way to prove your point.


(2015-04-03, 02:25 PM)Crazycat Wrote: [ -> ]So, the logical developments are to alway send the usergroup.

Yep. Especially that the usergroup argument is currently required by the function: https://github.com/mybb/mybb/blob/featur....php#L2961 so not specifying it at all as stated in the 1st post would even throw an error.

Yea because your reply made me angry. "I dont see its usefulness". huh.

Lets leave this.

"So, the logical developments are to alway send the usergroup"
^, huh -.-

So, the product manager says its a bug. I will be glad to see it fixed Smile
Pages: 1 2