1. The forums have been upgraded to XenForo 1.4. Please post any issues or comments here.
  2. Our hosting provider will be performing some scheduled maintenance and upgrading during the early morning (US time) of Tue 28th July, starting at approx 2am EST, which will require some down time of the server.

Problem using JUser Form Plugin

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

  1. agkata

    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.

    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?

    Regards,
     
  2. rob

    rob Administrator Staff Member

    Level: Community
    hi
    Can you post the settings your JUser plugin uses please?
    thanks
    Rob
     
  3. agkata

    agkata New Member

    Level: Community
    Hi!

    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 ?

    Thanks!
     
  4. rob

    rob Administrator Staff Member

    Level: Community
  5. agkata

    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
    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?

    Thanks!
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    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.

    WHERE
    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

    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

    cheesegrits Support Gopher Staff Member

    Level: Community
    w00t!

    I love it when stuff works.

    -- hugh
     

Share This Page