Copy row and joined tables

lcollong

FabriKant d'applications web
Hi,

I've read some threads related to the subject but I'd like to make it clear (at least for me! ) and, may be, add some explanations in the wiki.

Here is the behavior I've experienced with a very fresh github version of F3.2 under J3.3.6

1/ The form "save as copy" feature.
This is making a copy of the current record including right behavior for elements joined to an external table through an intermediate one (n-n relationship). At least for the J!'s tags element and for the multi files upload element I've tested.
However, the custom joined tables (through list join setup) are not updated with the new FK couples.

2/ The list copy plugin
The main list rows selected are copied but the plugin is making strange things with the intermediate tables. For the tags element, it "creates" its own FK id to the J! table where the intermediate table values are "0" for the J! FK. And for the multi file upload element, it replaces the path to the image with a single number.
The custom joined tables are not updated at all.

I understand that the joinded element (n-n) managed by Fabrik itself such as the ones I have tested and the DBjoin rendered as checkbox for example should be copied without errors in any case. Is that right ? For both the form "copy as" feature and the list copy plugin ?

I also understand that the custom joined data won't (never ?) be copied as it involves too much parameters to take care of. Is that a "statement" ?

It would be nice to have a way to easily trigger some php to make this stuff ourselves. For the form "save as copy" feature, I would imagine a php plugin triggered "OnAfterCopy" or something like that. For the list copy plugin, we could be able to add some php to the copy parameters to endorse the work of copying the 'n-n' intermediate tables the way we want.

For both, we should also have a way to fetch back the original PK and the new one in order to build the remaining SQL job (array of PK for the list plugin).

Am I understanding well ? Is there already some easier way to do it ?

Thanks for your feedback.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top