Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Call to a member function qn() on a non-object #193

Merged
merged 5 commits into from
Aug 9, 2011

Conversation

jonnsl
Copy link
Contributor

@jonnsl jonnsl commented Aug 7, 2011

No description provided.

@eddieajau
Copy link
Contributor

Hi Jonnathan. When are you seeing this error?

@WebMechanic
Copy link
Contributor

Same here and always failing. Due to the chaining, $query won't be initialized until all methods have "returned".
The call of ->leftJoin($query->qn('#__usergroups') ... fails, because at this point $query is still null.

@eddieajau
Copy link
Contributor

This actually works fine for me under PHP 5.3. I suspect it's something to do with PHP 5.2. However, a better solution would be to change $query->qn('#__usergroups') to $db->qn('#__usergroups') since we already have the database object (JDatabaseQuery::qn is just a proxy back to it anyway). The auto-formatter also made mince-meat of this block so if each chain could be put on a new line that would be great too.

One last thing. Could you update the changelog with a short message (see https://github.com/joomla/joomla-platform/wiki/Contributing-to-the-joomla-platform for more information). It's helps us all keep things up to date if we get in the habit of doing it with the pull request :)

Thanks in advance.

@jonnsl
Copy link
Contributor Author

jonnsl commented Aug 9, 2011

I'm getting this error under php 5.3.1, anyway... I updated the changelog and did some code formating.
PS: I hate this 'Comment & Close' button.

@jonnsl jonnsl closed this Aug 9, 2011
@jonnsl jonnsl reopened this Aug 9, 2011
@eddieajau
Copy link
Contributor

Ha! Yes, too close together. Thanks for that - looks great. Can you just merge down from joomla-master so I can auto-merge. Thanks.

@jonnsl
Copy link
Contributor Author

jonnsl commented Aug 9, 2011

done

eddieajau added a commit that referenced this pull request Aug 9, 2011
Call to a member function qn() on a non-object
@eddieajau eddieajau merged commit 21fa311 into joomla:staging Aug 9, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants