Table shows items many times

When I output a list, it puts many times the same item in it:
http://ortho2.newspectives.nl/index.php?option=com_fabrik&view=list&listid=13&Itemid=130

I checked the database, but all items are in there once. THere are various fields listed as primary though, which looks strange. I tried to delete the table in the database and recreate it, but again it puts more of them as primary keys.

I think also because of this the autofill plugin doesn't work properly, as it probably goes into a loop, or can't find just 1 item.

See both attachments.
 

Attachments

  • screen-capture-16.png
    screen-capture-16.png
    48.9 KB · Views: 196
  • screen-capture-17.png
    screen-capture-17.png
    106.2 KB · Views: 187
at a guess I would say that your list has a join in it, which is creating the additional rows in the list view.
To condense that down, edit the list:

go to the data->joins section
set 'display mode' = 'merge rows'

hth
Rob
 
yes there's some notices being triggered in the ajax call that is stopping the returned text being parsed as JSON.
The notice line number doesn't jive with the code that I can see in the current github codebase. Could you update from github and see if that fixes it? If not is it ok for me to ftp in and test on this site - or is it live?

-rob
 
I installed the latest package (rc2), but the problem is still there. You can FTP, no problem, its a testing place.

I'm now putting the last github I could find,just to be safe, but I think the problem is somewhere else.

Sorry for the times in between answering, it's a rather busy time.
 
I have a question though, is it possible to pre-fill a form with repeatergroups? Like my therapies have repeatergroups for supplements and medicin, and I want to pre-fill a "behandelplan" for the patient with the same repeatergroups? Or is that not possible with Fabrik. I would understand if that's a complex operation not usually needed.

If not, what would be the best way to get a similar result?
 
hi
Thanks I was able to get the right line number, and have fixed it on your demo site and with this commit to github:
https://github.com/Fabrik/fabrik/commit/541a0fd7f483adad12b05899cfaec2fe2bab4402

I have a question though, is it possible to pre-fill a form with repeatergroups? Like my therapies have repeatergroups for supplements and medicin, and I want to pre-fill a "behandelplan" for the patient with the same repeatergroups? Or is that not possible with Fabrik. I would understand if that's a complex operation not usually needed.

I think at this point you would have to write some javascript with a custom ajax call to duplicate the repeating groups the number of required times, and prefill with the correct data.
 
Thanks, that looks good.

About this custom script, is that something I could ask Fabrik to make? Paid of course? I wouldn't really know where to start I think. Let me know if this is possible and what you would ask for developing that.
 
Can you be a little more specific about what you need? Specifically, how you would want to select what information to fill in on the repeat groups, and how many groups you need, etc. Would it always be the same information on the same number of groups for everyone, or would it depend on the person filling out the form, or on the selection from the "kies patient" element?

--hugh
 
Dear Hugh,

I will make it shortly and you can see what I need, but basically it's an exact copy of the "therapie". So if under a standard "therapie" there are let's say 4 foodsupplements with their data on when to take them, 2 advices, and 2 medicin and when to take them, I want there to come an exact copy of that therapie in the "behandelplan". One thing that needs to be is that after that copying the therapist can still add more supplements or advices (advies) or medicins to it, as if you are constructing a new "therapie".

Maybe there is an easy solution other than a prefill, but with copying the whole form or something, I don't know, that's up to you.
 
Any news? I was thinking about maybe there's a way to include a whole form in a form? Or I can find another sort of solution for this problem. As there are repeat groups it would be impossible to have repeat groups inside repeat groups I guess.
 
I've looked at the site, and read this thread several times, but I'm still not clear what the relationships are. Part of it is a language barrier, as it's not easy "visualizing" the issue when I don't understand a word of what I'm seeing on the page.

But I think we could clear that up if we could spend a few minutes with you waling me through the site and explainin what you need to do in live chat.

I *think* I know what you are trying to do, and I agree with Rob, in that this would require some custom JS, which makes an AJAX call to the server, looks up the "therapies" needed for this patient, and creates and pre-fills the repeat groups. What I'm still nto clear on is what "key" we would use to look up which therapies are needed. But that's what we could clear up with some one-on-one time.

So, can you use the Live Chat to get hold of me, or if you have me on Skype, grab me there next time you see me online, and we'll walk through your requirements. I've done similar work to this before, and it usually takes a couple of hours to get it done and tested.

-- hugh
 
Just to keep this one up to date. We spent a while on chat, and I now have a clearer idea of what is needed, although I'm not entirely sure how to go about it.

Basically, there's one list of what one might call "standard treatment plans", which is made up of multiple repeat joins to various aspects of a treatment - supplements, medicines, infusions. Then there's a patients list, which has the specific treatments for a given patient. HK wants to be able to choose from the 'standard treatments', which would take the various repeated bits of the standard plan, and add them as a collection of repeats to the patient form, but not as joins, as they may or may not need customizing.

This just isn't going to be easy. For simpler cases of "choose something from another table and add it to this one" we'd use the autofill plugin, but I don't think that will handle the arbitrary number of repeats.

I'll do some testing here, and see what would be involved in adding this capability to the autofill, but I'm not hopeful that this approach will work.

-- hugh
 
Hi Hugh,

I got an idea though, which probably makes it simpler. It could be done this way I think, as the repeatgroups will be exactly the same:

When you choose a "template therapy" and press a button, just copy the database fields, so for example copy:
therapeut_therapien_17_repeat to therapeut_p_behandelplan_33_repeat and just replace the parent_id from the old table (the "template therapy") to the parent_id of the new therapy. I'm going to play around with this to see if I can manage this myself. But what do you think of the idea?
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top