dbjoin element in "repeat" mode AND in repeated group can't submit data

Jaanus

Super Moderator
Hi,
databasejoin element that is
rendering in "repeat" mode (checkbox, multiselect)
AND is also itself in repeated group
cannot submit data and
after submission attempt it returns this error message:

Store row failed:
Unknown column 'params' in 'field list' SQL=UPDATE `teos_perf_koos` SET `time_date`='2012-07-11 21:56:00',`teos_id`='333',`lisas`='42',`muutis`='0',`alg_id`='0',`koosseis`='',`params`=NULL WHERE id='60'


`teos_perf_koos` is a joined table.
join is from main table teos_mus_vers.id to teos_perf_koos.teos_id

`koosseis` is a field originally behind of dbjoin element.

'params' is actually an empty field with unknown purpose in the table `teos_perf_koos_repeat_koosseis` that exists behind the dbjoin element when it is in repeated mode.

In my case Fabrik form thought in some unknown reasons that this 'params' field is in the joined `teos_perf_koos` table. (Could this cause that data was not submitted?)

Unfortunately this time I couldn't find the exact source of the issue, so I ask help here. Otherwise you found a pull request instead.

P.S. rendering in form view and adding new values from frontend worked well, also displaying of earlier submitted data.
 
Confirmed, looking at it now.

Don't feel bad about not being able to find the problem ... the repeat join group and repeat element code scares and confuses me, and I helped write it!

-- hugh
 
Just to confirm something ... the joined table your checkbox join element is on ... was that created through our Group mechanism, i.e. creating a group and setting it to repeat, or was it a table you created by hand, and manually joined?

-- hugh
 
Submitted an issue for Rob on this one.

https://github.com/Fabrik/fabrik/issues/346

Rob - I commited one fix, which resolves the original error Jaanus reported, which is assuming the existence of a 'params' field in the join.

But even once that was "fixed", the checkbox join in my repeat table doesn't save anything, for reasons that are beyond me. Something to do with the join table ID, and the repeat totals array being built with the 'el' prefix. Upshot is that the code ends up thinking there are no 'repeats' for the checkboxes.

-- hugh
 
But even once that was "fixed", the checkbox join in my repeat table doesn't save anything, for reasons that are beyond me. Something to do with the join table ID, and the repeat totals array being built with the 'el' prefix. Upshot is that the code ends up thinking there are no 'repeats' for the checkboxes.

-- hugh

Being carefully optimistic I think that if this will be solved then it would be a solution for the "chain" joins within one list/form, e.g if we create in list admin 2 joins:

from main_table.id to joined1.parent_id
from joined1.id to joined2.parent_id

Such join show existing data but doesn't write joined1 pk value into joined2 fk field. And dbjoin element in checkbox/multiselect mode is principally the same if the element is in joined group.
 
Now I can't see the existing repeated dbjoin element data within joined group. I looked into the fabrikdebug and there we see that when being in joined group then it thinks that the parent_id should equal to the main table's pk.
Below the corresponding parts of 2 queries are compared. First when the dbjoin rendered as checkboxes is within main table, the second when it is within the joined group. The right table name is green, the wrong one is red

Data in original list & group
form:render
SELECT SQL_CALC_FOUND_ROWS DISTINCT `teos_perf_koos`.`id` AS `teos_perf_koos___id`, `teos_perf_koos`.`id` AS `teos_perf_koos___id_raw`, `teos_perf_koos`.`time_date` AS `teos_perf_koos___time_date`, `teos_perf_koos`.`time_date` AS `teos_perf_koos___time_date_raw`, `teos_perf_koos`.`teos_id` AS `teos_perf_koos___teos_id_raw`, `teos_mus_vers`.`title` AS `teos_perf_koos___teos_id`, `teos_perf_koos`.`lisas` AS `teos_perf_koos___lisas`, `teos_perf_koos`.`lisas` AS `teos_perf_koos___lisas_raw`, `teos_perf_koos`.`muutis` AS `teos_perf_koos___muutis`, `teos_perf_koos`.`muutis` AS `teos_perf_koos___muutis_raw`, `teos_perf_koos`.`alg_id` AS `teos_perf_koos___alg_id`, `teos_perf_koos`.`alg_id` AS `teos_perf_koos___alg_id_raw`, (SELECT GROUP_CONCAT(teos_grupp.title SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis LEFT JOIN teos_grupp ON teos_grupp.id = teos_perf_koos_repeat_koosseis.koosseis WHERE teos_perf_koos_repeat_koosseis.parent_id = teos_perf_koos.id) AS teos_perf_koos_repeat_koosseis___koosseis, (SELECT GROUP_CONCAT(id SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis WHERE parent_id = teos_perf_koos.id) AS `teos_perf_koos_repeat_koosseis___koosseis_raw`, (SELECT GROUP_CONCAT(koosseis SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis WHERE teos_perf_koos_repeat_koosseis.parent_id = teos_perf_koos.id) AS teos_perf_koos_repeat_koosseis___koosseis_id, (SELECT GROUP_CONCAT(params SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis WHERE parent_id = teos_perf_koos.id) AS `teos_perf_koos_repeat_koosseis___params`,

Data in joined group:
form:render
`teos_perf_koos`.`id` AS `teos_perf_koos___id`, `teos_perf_koos`.`id` AS `teos_perf_koos___id_raw`, `teos_perf_koos`.`time_date` AS `teos_perf_koos___time_date`, `teos_perf_koos`.`time_date` AS `teos_perf_koos___time_date_raw`, `teos_perf_koos`.`teos_id` AS `teos_perf_koos___teos_id_raw`, `teos_mus_vers_1`.`title` AS `teos_perf_koos___teos_id`, `teos_perf_koos`.`lisas` AS `teos_perf_koos___lisas`, `teos_perf_koos`.`lisas` AS `teos_perf_koos___lisas_raw`, `teos_perf_koos`.`muutis` AS `teos_perf_koos___muutis`, `teos_perf_koos`.`muutis` AS `teos_perf_koos___muutis_raw`, `teos_perf_koos`.`alg_id` AS `teos_perf_koos___alg_id`, `teos_perf_koos`.`alg_id` AS `teos_perf_koos___alg_id_raw`, (SELECT GROUP_CONCAT(teos_grupp.title SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis LEFT JOIN teos_grupp ON teos_grupp.id = teos_perf_koos_repeat_koosseis.koosseis WHERE teos_perf_koos_repeat_koosseis.parent_id = teos_mus_vers.id) AS teos_perf_koos_repeat_koosseis___koosseis, (SELECT GROUP_CONCAT(id SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis WHERE parent_id = teos_mus_vers.id) AS `teos_perf_koos_repeat_koosseis___koosseis_raw`, (SELECT GROUP_CONCAT(koosseis SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis WHERE teos_perf_koos_repeat_koosseis.parent_id = teos_mus_vers.id) AS teos_perf_koos_repeat_koosseis___koosseis_id, (SELECT GROUP_CONCAT(params SEPARATOR '//..*..//') FROM teos_perf_koos_repeat_koosseis WHERE parent_id = teos_mus_vers.id) AS `teos_perf_koos_repeat_koosseis___params`,


And when we look fabrikdebug in list view - there are the same differences.
 
I've looked at this and basically I'd need to rewrite a large part of the join code to enable repeat elements to work within repeat groups. Its something we want to do but not in a point release.

So for now we'll have to say that this is not a possible combination of features. Whilst we work on a branch to rewrite the join code

-Rob
 
Hi,

Does this feature working now?

database join rendered as checkbox /multiselect list within repeat groups
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top