New Fabrik user and I've encountered this strange issue using MySQL Views.
I'm working on a rather basic app where the data are in basically in two main tables in a many-to-many relationship, Customer and Services (a customer can purchase many services and a service can be bought from many customers). In reality it's a bit more complicated than that, but this basic model should replicate the issue.
So far the idea is to first create a customer, and then you can either create a new service and assign that customer there, or if he wants a service already created you can add him with a repeatable group.
Viewing the details of the records, there is no problem with the Services details showing all their customers. The problem is that I want to view in the details of each customer's form a list of all the services he has bought (another repeatable join).
If I leave the tables connected, when I create a customer, since the repeat group shows up in his form, if I won't fill it in with anything (as I don't know yet what service he wants), a new blank record is created in the Services table.
To avoid deleting all the empty records, I created a MySQL View of the Services table(named it View_Services) that I've joined with the Customer list, as I would join the Services table, and make the group Read Only (as I just need to view a list of the customer's services, not add services from the customer's form). All groups are set to Repeatable etc. And here is where the issue appears.
While in the list view of Customer all the data appear, when I view the details of the customer only the first record appears. Using fabrikdebug this is what I found:
form:getData returns an array of objects with all the data as they should be, while form:data only returns the 1st of the objects among all other data.
After searching the forums this bug seems pretty similar to another thread. I can't post links yet but the thread title is "Repeat group from view join shows only one item" from October 2014.
If I use the repeatable List join with the original Services list and not the View_Services I get the correct results and behaviour in the Customer form.
Is this a known bug of Fabrik? Perhaps github issue #708 is the same?
Any ideas on how to fix that, or another way to work around this issue would be greatly appreciated.
I'm working on a rather basic app where the data are in basically in two main tables in a many-to-many relationship, Customer and Services (a customer can purchase many services and a service can be bought from many customers). In reality it's a bit more complicated than that, but this basic model should replicate the issue.
So far the idea is to first create a customer, and then you can either create a new service and assign that customer there, or if he wants a service already created you can add him with a repeatable group.
Viewing the details of the records, there is no problem with the Services details showing all their customers. The problem is that I want to view in the details of each customer's form a list of all the services he has bought (another repeatable join).
If I leave the tables connected, when I create a customer, since the repeat group shows up in his form, if I won't fill it in with anything (as I don't know yet what service he wants), a new blank record is created in the Services table.
To avoid deleting all the empty records, I created a MySQL View of the Services table(named it View_Services) that I've joined with the Customer list, as I would join the Services table, and make the group Read Only (as I just need to view a list of the customer's services, not add services from the customer's form). All groups are set to Repeatable etc. And here is where the issue appears.
While in the list view of Customer all the data appear, when I view the details of the customer only the first record appears. Using fabrikdebug this is what I found:
form:getData returns an array of objects with all the data as they should be, while form:data only returns the 1st of the objects among all other data.
After searching the forums this bug seems pretty similar to another thread. I can't post links yet but the thread title is "Repeat group from view join shows only one item" from October 2014.
If I use the repeatable List join with the original Services list and not the View_Services I get the correct results and behaviour in the Customer form.
Is this a known bug of Fabrik? Perhaps github issue #708 is the same?
Any ideas on how to fix that, or another way to work around this issue would be greatly appreciated.