SOLVED: Element placeholders in repeated group not constructed correctly.

bggann

Active Member
Not even sure how to describe this.
Working on a tracking form where there is a main group "daily_log" and several repeated groups "xxx_flight leg"
Initially we were going to high/show the groups based on a choice in daily_log. Thanks to Hugh for updating the system to hid/show the tabs.

For a variety of reasons, we decided to restructure this to avoid conditional coding - validation on hidden values, etc. As we got further into it we understood the scope better and it became obvious that a more segregated approach would make sense.

So - we restructured.
Group daily_log became 3 groups (non-repeated), mma_daily_log, heli_daily_log, seat_daily_log.
The repeated groups were already separate (mma_flight_leg, etc.).

The underlying tables are the same (list mma_daily_log and heli_daily_log and seat_daily_log) all point at a db table daily_log.

The repeated groups point at different tables - such as daily_log_12_repeat___mma_flight log.

Many of the elements in the groups are identical - so they are parent-child pairs. Only where they must be different are the elements separated.

It the process of doing this - we have broken something.....
Became evident doing a calc field in a repeated group. The calc would work if the 3 fields involved (2 inputs, one output) were in the main group, but not in the repeated group.

Adding dumps in the calc it appears we have somehow broken the linkage. The element names in the $data array are not complete.

In the dump of $data it will say, for instance,

___Hobbs_Start_Time.

The element is
daily_log_12_repeat___Hobbs_Start_Time
Notice the "daily_log_12_repeat" is missing from the $data rendition
Thus the calcs don't work.

Attached is a screen capture of the dump output and a portion of the element list to illustrate. Notice how the full name is not in the data dump.

Obviously, we broke something when we split the groups. What is the best way to recover? It is to start over, or is there some database repair we can do.
Note - the tables (in php) are "close" to right.
The site is the aviation one in my sites.dump_output.PNG element_list_capture.PNG
 
Hmmm. Yes, looks like something has gotten hosed up in the metadata. It seems that you've tried to move those dailhy_log_12_repeat elements from their own table, to the main daily_log table. Or at least, have lost the relationship with their own repeat table.

I can try and have a stab at fixing it by setting a manual join, but ... it's likely I'll blow your setup away.

If you have a backup from before you restructured, I'd just restore that and let me look at what it is you are trying to do.

If not, do a backup, and I'll see if I can repair it from the Fabrik UI.

-- hugh
 
Yeah- I'm not sure what we did. We had it configured for one "daily_log" and used create a new list specifying the db table daily_log to create the new ones. The repeating groups existed, so we just moved them from one "form" to a new form. But, those links broke.
I could get a restore from the hosting site - that would be before we did any of this - but I'm not sure it is worth it. Jon (the other guy) and I could start fresh and re-create it all pretty quickly without sucking up your time.
We'll talk about it and let you know. Don't worry for now.

Bob
 
OK.

BTW, a big clue is that if you try and edit any of those elements, you get a "COM_FABRIK_JOIN_NO_PK" warning. Which means we can't figure out what the primary key of the joined table we thin those elements are on. And if you look at the main table they are supposed to be a repeat on, there's no join.

-- hugh
 
BTW, one good habit to get into is doing an Akeeba backup before doing any kind of wholesale changes in Fabrik. Especially when moving elements around between groups, or changing join structures, etc. We don't often get our metadata knickers in a twist, but it can happen, especially when moving elements around between forms / groups / joins.

And setting Akeeba to do a daily database backup automagically won't hurt either. So the most you ever lose is a day.

-- hugh
 
Yeah- I got lazy on the Akeeba because we were 'experimenting'. The problem was how I did the creation of the extra/new groups. I tend to do Akeeba's when I do major work. The site is backed up daily by our hosting provider - not quite as easy, but workable.
What I did was get the database restored from our nightly backup and then we re-did the work being more careful about it. Since most of the elements are parent/child and we are just adapting what is displayed, it was not that much work.
Have it nicely working now - doing just what we expected now.

blob
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top