[Dropped] Upsert not inserting values for lists with repeatable groups

aijosh

Member
Hello,

I have a form that uses the upsert plugin to add values to a couple of other lists.

I noticed all lists without repeatable groups gets inserted ok but I those with repeatable groups never get inserted.

How do I solve this?
 
The data of a repeatable group is stored in an additional table
parent-table_groupID_repeat with columns id, parent_id, group-elements

I assume the upsert plugin doesn't support mapping of repeat group elements or you have to add an additional upsert for the parent-table_groupID_repeat.
What did you map, what do you expect to happen?

But you can always use a php plugin do your specific "upsert" via php code.
 
This is what I did.
I created a list with all the required elements
I moved all repeatable elements to another group and made it repeatable

I need users to be presented with only their own data when they visit the form after logging in to their profiles.
I created the menu for this list's form and added Row id -1 to display users record

ISSUE: If there is no record for the user (new users), the user is presented with a form that cannot be filled as ONLY the LABELS OF ELEMENTS SHOW (Note: [.a] I also dont want users to be able to add records, so there wont be duplicate rows for each user, just edit their own single record [.b]users need to just be presented with their records. no need to bother them looking for an add/edit button)

SOLUTION: On registration, I insert values for date-time and userid into the table for this list using UPSERT

PROBLEM: Solution does not work for repeatable groups

What I mapped:
Form A | Form B (Repeatable)
=======================
UserID | UserID
Date_time | Date_time

I did not map any of the repeatable elements. Just the date and user id which does not repeat

On submitting Form A, all other lists have their respective userid and datetime except for List B which remains empty for both the parent and the repeats.

PS:
If the upsert wont be able work for this can you please provide a php snippet I can use to insert the user id from the registration form into the table required. I tried using the element placeholder for the userid but it returns a blank value
 
Not sure what you are doing.

The menu with rowid=-1 is exactly for what you are describing:
If the user doesn't "own" a record (precondition: the record has an element storing the Joomla userID, this is NOT the primary key of the record) he will get the empty form for adding a record (precondition: list access setting "Add record" = registered (or public)),
if there's alread a record he gets the form with the data for editing (precondition: list access setting "edit record" = registered)

To prevent the user from seeing (and editing) records from others set a prefilter.
http://fabrikar.com/forums/index.php?wiki/list-pre-filters/

If the user should be able to see all records but edit only his own one set "canEditRow" list plugin.
 
What I'm trying to achieve is what I described above. I was trying to be as thorough but also brief as possible but I guess that didn't work out.

The prefilter you described doesn't solve my problem, also the canEditRow.

What I need to do is to insert the USERID from the registration form of the new users registration into another table.

In any case I'd found a way around this using the php plugin. I created a select userid using the username on the registration form username, then inserted the returned userid into the second table.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top