1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

[solved] Fabrik won't allow two userid in a List

Discussion in 'Standard Support' started by aijosh, Dec 4, 2018.

  1. aijosh

    aijosh Member

    Level: Standard
    I keep getting a 500 error except I unpublish one of the userid.

    LIST A
    id, userid, post

    LISTB
    id, userid, postid, comment

    I want the post and comments on a single list view so I created

    LISTC (a copy of LIST A) then joined LISTB to it. id->postid

    LISTC
    id, userid, post, id, postid, comment

    ISSUE:
    When trying to load LISTC I get a 500 error. Says fabrik has generated an invalid query. <br/>

    If I unpublish either one of the userid the list loads.

    If I also remove the join, the LISTC loads without issues.

    I guess fabrik doesn't understand why there can be two different userid in a list. Cos the "commenter" and the "poster" are not the same.

    It's there a way to solve this?
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    No, you can have multiple user elements in one list.
    Enable Fabrik debug (in Fabrik Options/Debugging) and add &fabrikdebug=1 (resp. ?fabrikdebug=1 if it's the first URL param) to the URL of your List C to get the complete error message.
     
  3. aijosh

    aijosh Member

    Level: Standard
    500 Fabrik has generated an incorrect query for the list View Wall: <br /><br /><pre>Column 'name' in field list is ambiguous</pre>

    Still doesn't make sense cos there is no column bearing "name" in the two lists
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Do you have any custom prefilters or join WHERE clauses?

    What user table field are you displaying? Username, name, email etc?

    -- hugh
     
  5. aijosh

    aijosh Member

    Level: Standard
    No prefilters on any of the lists

    THESE ARE THE ELEMENTS OF LIST C AND WHATS DISPLAYED
    LIST A (POSTS) LISTB (COMMENTS)
    id,user, post id, postid,user,comment

    **The user element is a databasejoin for userid with Or Concat label = name,' ',lname
    ***Also I have a php event list plugin on the comment form which adds the picture of the user to the name and last name. I couldn't get the picture with or concat since it was a fileupload element.
    (Although I don't think the plugin is an issue cos I disabled it but the problem persisted)

    Thanks
     
  6. aijosh

    aijosh Member

    Level: Standard
    Just removed the name,' ',lname in the Or Concat and the form now loads.
    I guess its the syntax used or maybe it just doesn't work on joined tables????
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    aijosh likes this.
  8. aijosh

    aijosh Member

    Level: Standard
    Ok. Thanks. I think that would work but I'd decided to unlink the userid from their parents then removed the on Concat and then used a php event list plugin to call the name, lastname and picture.

    Though I'm having issues displaying the profile picture of the comment portion.

    It tells me;
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1.

    This same query works on the picture of the post owner.
    The query also works if I put the id of the comment owner manually in the WHERE portion but doesn't if I put the value from the $commenterid = $row->comments___userid_raw;
     
  9. aijosh

    aijosh Member

    Level: Standard
    casted it and it works now (int)$row->comments___userid_raw;
     

Share This Page