• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Multiselect dropdown dbjoin problem.

jh

Member
Hi

I seem to have run into a bit of a problem with elements set as a multiselect dropdown dbjoins.
I have 2 tables joined - says table A and table B. Table A has a few multiselect dropdown dbjoins to other tables. This all works and presents fine, both on table A when inputing/viewing data and when joined to table B.


However when a record is deleted from table B, I have found that the values of any multiselect dropdown dbjoins in table A is now blanked. I have checked on CSV file and the values have gone . No other field values are gone (including single select dbjoin fields).

I have tried a few different things but I can not seem to stop this from happening. Have a got a setting wrong somewhere?

Kind Regards
 
I can't replicate this.

When you say "when a record is deleted from table B", you mean directly from the list built on table B?

Can you have a look directly in MySQL, using phpMyAdmin (or whatever). there should be a table called <table_a>_repeat_<element_name>, using your table A name and the join element's name, which is the "junction" table between table A and B. It will have four fields, id, parent_id, <element name> and params. The parent_id will have the ID of the table A row (parent), <element name> will have the ID of table B (child).

Can you confirm whether any of those rows are changing when you remove something from table B?

-- hugh
 
Hi

Thanks for your reply.

To confirm:

"When you say "when a record is deleted from table B", you mean directly from the list built on table B?"

yes to this (deletion is on the admin list side for table B). Table B has an inner join to table A.

I have looked at the tables in phpMyAdmin (they are there and work as expected I assume when adding data). However when the record is deleted from table B, then this record is deleted too (completely removed).

Also, and apologies if I wasn't clear, the multiselect drop down on table A is to table C (so the child ID is to table C).

Should I not be deleting a row from a list with a join like this or is there some other error I have made.

EDIT:
Ive just tried deleting from a list of table B without the join and the deletion does not occur. I assume the deletion occured because of the join. Apologies if I hadnt quite grasped how the join was working as no other elements seemed to be affected.

Thanks for your help.
 
Last edited:
the multiselect drop down on table A is to table C (so the child ID is to table C).

Sorry, I'm totally confused. How are A, B and C related?

The only way values for the multiselect join could be removed is if the rows in that autoatically created junction table are deleted for a specific parent_id.

-- hugh
 
Hi

Sincere apologies for not being clear:
Table A - Pattern
Table B - Item Type
Table C - Colour

Table A has a multiselect dbjoin element to Table C. Works fine for inputing, display and related record link.
Table B is joined to Table A via single dbjoin.

For a list view, table B is joined to table A via table B FK.. All information displays correctly.
However when deleting on this list view, the multiselect dbjoin values are deleted on table A (no other entered values seem to be deleted).
I realised this only occured when deleting on the list view with the join (from table B to A). When deleting directly from table B (without the join) this delete does not occur.
Apologies if I have not realised the table/list join has caused the delete however I would like to be able to delete on the joined table view without this occuring.

Kind Regards
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top