JUser pt4

2 views
Skip to first unread message

Paladin

unread,
Nov 24, 2009, 12:44:00 AM11/24/09
to Joomla! Framework Development
or, "Won't this nut shut *up* already?"

Now I'm crawling through JUser::load(), and it's not working the way
I'd expect it to.

Do a "new JUser(1120)" or whatever user number you need to make it a
non-existent one.

It calls user->load(1120) which does a getTable to pick up a
JTableUser object and does a table->load(1120).

On a false return it will throw an error. But...

JTableUser::load doesn't return false for a non-existent user number.

On an unknown user, line 158 db->loadAssoc()) the query returns an
empty array. The later bind of that empty array returns a true, which
is returned to the call.

If you don't give it any id to look for, it returns false, but so long
as you give it a non-null id, it appears to return true, whether the
id exists or not.

I don't think this is right, but I'm not sure where the false should
be set, in JTableUser::load before bind is called, or in JTable::bind
so as to replicate the change across more than just the user table
work.

Hannes Papenberg

unread,
Dec 11, 2009, 7:05:08 PM12/11/09
to joomla-dev...@googlegroups.com
I wouldn't add it to the JTable::bind() call, since in my understanding
bind() should bind an array, regardless of it being empty or not. As
long as it is an array, it should return true.

Hannes

Paladin schrieb:
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
> To post to this group, send email to joomla-dev...@googlegroups.com
> To unsubscribe from this group, send email to joomla-dev-frame...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/joomla-dev-framework?hl=en-GB
> -~----------~----~----~----~------~----~------~--~---
>
>
>

Reply all
Reply to author
Forward
0 new messages