Something wrong with the user element after last update

Status
Not open for further replies.

jfquestiaux

Well-Known Member
I have a simple contact form that includes a user element (to catch the ID of the logged user in case he uses the form).
After the latest GitHub update (417), I get a "0 - SQL=" error when I try to access the form (or any form having a user element for that matter). Unpublishing the user element regains access to the form.

Using fabrikdebug, it seems that the #__ prefix is not replace by the actual prefix, so the SQL request is looking for #_users, which of course does not exist.
 
hi
I'm unable to replicate this. Is it still an issue? Can you provide more information?

thx
Rob
 
Well, if I upload the "user" element from GitHub 335 into the 417 update (I know, I tell everyone NOT to do this!), the error is gone and the user id is recorded correctly. So it is something that happened between these two releases.
 
Well I think it may be this :
PHP:
@@ -755,7 +755,10 @@ public function getFilterQuery($key, $condition, $value, $originalValue, $type =
 
    // $$$ hugh - we need to use the join alias, not hard code #__users
    $join = $this->getJoin();
-    $joinTableName = $join->table_join_alias;
+    if (is_object($join))
+    {
+      $joinTableName = $join->table_join_alias;
+    }
    if (empty($joinTableName))
    {
      $joinTableName = '#__users';

From your merge on April 15
 
Hmmm, well that change shouldn't actually cause this problem, as if $join is not an object, we can't get the alias name for it. Although it's slightly worrying that I added that sanity check, as it means I must have experienced an issue where an error was being thrown because $join wasn't getting set. Which means I was probably being lazy, and just masking a problem, rather than finding out WHY $join was empty. And I further suspect you have stumbled on the same issue.

Can you paste the actual SQL error being thrown? If I recall correctly, when we show queries in fabrikdebug, the #__ won't be replaced, as that only happens when a query is actually executed. Although I may be wrong.

-- hugh
 
Well actually I've never seen this kind of error. Usually you have a "unknown column" or "syntax error" with the whole SQL request printed out.
Here it is just "0 - SQL=". Not much help there.
But using fabrikdebug, I recall that I was able to see the MySQL request and there was "#__users" in it, causing the error.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top