1. Hugh is now back at work, more or less full time, after a slower than expected recovery from his neck surgery early this month. Obviously we have a backlog of support to clear, and are working as hard as we can to take care of it. If you have an unanswered thread more than 3 days old, please post one (and only one) "bump" on it, to move it in to our "last 3 days" list. If you have an unanswered issue in a forum you no longer have access to due to subscriptions timing out, please use the Contact Us form, and provide us with the URL to the thread.

Problem using JUser Form Plugin

Discussion in 'Fabrik 3.x Testing' started by agkata, May 6, 2012.

  1. agkata New Member

    Level: Community
    I've tried to use JUser plugin, and I have had a similar problem this thread http://fabrikar.com/forums/showthread.php?t=25875&highlight=Duplicate entry (I have no permissions to quote this, sorry about the link).

    It was my steps:
    1. Created and saved a List linked to ##_users (Joomla users)
    2. Set up JUser plugin for the form
    3. I set up a default user group and I don't know if it is associated with the problem.

    When I try to insert a new register using the form, I get the error message:
    "Store row failed:
    Duplicate entry '0-10' for key 1 SQL=INSERT INTO `#_user_usergroup_map` ( `group_id` ) VALUES ( '10' )"

    Can someone help me?

  2. rob Administrator

    Level: Community
    Can you post the settings your JUser plugin uses please?
  3. agkata New Member

    Level: Community

    Thanks for the response rob!

    I used the following configurations:

    Name field => Nome
    User ID field => ID
    User group field => -
    Default user group => -- Corretor // this is a new group created at J! administrator by me - registered with ID 10.
    Delete Users => No
    Bypass Activation => Yes
    Bypass Registration => Yes
    Bypass Joomla's Account details email => No
    Auto Login => No
    Synchronize Users => No
    Sync on Edit => No

    I don't know if I'm right about your question, is this the expected response ?

  4. rob Administrator

    Level: Community
  5. agkata New Member

    Level: Community
    hi Rob, I tried your suggestion, but it didn't works =(

    Today I tested another things to resolve my problem...

    My configuration "groups" (in my Form configuration) is:
    Corretor -[#_user_usergroup_map]

    In my list configuration, I made a Join to #_user_usergroup_map table to get just registers of "Corretor" group in my list.

    When I remove Corretor -[#_user_usergroup_map] in form configuration or remove my join in list configuration, I don't get the error anymore (Store row failed...) , but my list brings me all the user registers and I want to get just registers from an especific group.

    Is there another way to bring the records belonging to a particular group without make a join?

  6. cheesegrits Support Gopher

    Level: Community
    Ah, you didn't mention having a join to the usergroup map table in your original post. And as the uergroup map doesn't have a simple numeric primary key, it's a little difficult to handle as a joined table in Fabrik.

    However, you shouldn't need to join it. You can do what you need with a pre-filter, using a subquery.

    Field: id
    Condition: IN
    Value: SELECT user_id FROM #__user_usergroup_map WHERE group_id = '123'
    Type: Query
    Apply to: (whatever access level you need the filter to apply to)

    And obviously change '123' to whatever the ID of the group you want to restrict access to is.

    -- hugh
    1 person likes this.
  7. agkata New Member

    Level: Community
    sorry, I really had not mentioned other settings in my original post.

    so, I used the subquery as you suggested me, and it worked!

    Thanks!!! :D
  8. cheesegrits Support Gopher

    Level: Community

    I love it when stuff works.

    -- hugh

Share This Page