[Solved] Related add not prefill id of database join element

yodam

New Member
Hi,
On Fabrik wiki:

Links to Forms:(top)
Link to form - creates a new column with a link to the related table's form. The database join element will be pre-filled with the active records value.


Why I have a void field on database join element when I click on the link for adding a new element?


On main list I have:

Related data>Show related add:yes
On Forms Link to form:yes

On secondary list:

element main_list_id it's a databasejoin to main list (table) id

Thanks!
 
It's definitively working.
Did you restrict the access to your dbjoin element?
You can set it to hidden, but the user must have add access.

Or didn't you select "id[recommended]" as dbjoin value?
 
It's all public acces and set to id[raccomanded]. I had copies of the list for different access levels so I've putted ALL on ALL join-on to public. I've also used public for the list on all access

Is it possible that doing copies create problems on related data?

Thanks!
 
Last edited:
Doing copies should be fine.
But it's easy to be confused if you have a lot of copies (with all child elements, similar or equal list/form/group names etc).

If adding a record via related data add you should have an URL to your form like
...form/51?referring_table=43&strassen___j_stadt_plz_raw=2

So this link was called from my list with id 43 (resp. my details view of a record of this list), is opening the form with id 51 and prefilling the dbjoin element strassen___j_stadt_plz with the (raw) value 2 (which is the record id of the "calling" record in list43)
 
On master list: index.php?option=com_fabrik&task=list.view&listid=18

On master detail: index.php?option=com_fabrik&task=form.view&formid=18&rowid=1

On module of secondary list: index.php?option=com_fabrik&task=form.view&cid=17&formid=17&referring_table=18&serv_messaggi___id_ordine_raw=1

What do you think about?

if this can help you, if I show the join-on field I have a void html select with no options selectable

Thanks!
 
Last edited:
"&task=list.view"
Are you working in the backend? This is no regular frontend URL

What do you mean with "module"?

The dbjoin should show all entries of your selected table, no matter if the form is opened via related data or directly via list add or edit.
Something seems to be mixed up with your settings.
Did you modify your elements AFTER enabling related data in your list?
Or do you have something added to "Data-where" or "Advanced" in your dbjoin element?

I would try to set up a new example with all default settings for testing.
 
1) Yes I'm working on backend but I will show in frontend at the end. Can I? is it better if I work on frontend?

2) Module is where I input data of secondary table (the table with join-on element)

3) Is possible I've modified the element join-on after enabling related data. I don't remember

4) Data-where and Advanced are blank (not touched)

Thanks!
 
If in your form your dbjoin element doesn't show all entries of the "master" table then it's a mistake in your setup.
This is not related to "related data" (related data add is only selecting the id of the "master" record as default, but if there are no ids at all there's nothing to be selected).

Frontend/backend doesn't matter, related data is working on both sites.
 
Hi,
I did two new tables with English names. The tables are Orders and Messages (with join-on order id). The problem is not solved

1) I've used all default options
2) I attach images of what I did (the file name help you to understand the page). If you need other images I will do them.
3) I'm using the administrator user on Joomla backend

Thanks!!
 

Attachments

  • orders_elements.png
    orders_elements.png
    47.2 KB · Views: 304
  • messages_elements.png
    messages_elements.png
    50.5 KB · Views: 305
  • messages_join_on.png
    messages_join_on.png
    34.6 KB · Views: 162
  • messages_form_options.png
    messages_form_options.png
    14.3 KB · Views: 324
  • orders_related_data.png
    orders_related_data.png
    36.4 KB · Views: 328
  • orders_data.png
    orders_data.png
    23.9 KB · Views: 340
  • orders_add_message.png
    orders_add_message.png
    49.1 KB · Views: 158
  • Fabrik_options.png
    Fabrik_options.png
    19.4 KB · Views: 166
  • Fabrik_options_permissions.png
    Fabrik_options_permissions.png
    28.4 KB · Views: 141
Last edited:
There's something screwed up on your site:

In orders_elements.png you are showing a form of the the "serv_orders" table with columns id and price!

Your message dbjoin element is going to a table "serv_orders" but with a label (= column name) text, which is obviously not the same table used in your orders_elements.png and which seems to be empty (so the dropdown is showing nothing but "Please select")

Do you have multiple Fabrik connections, i.e. multiple databases?
With the tables with identical names?

Anyway: you can't do "cross-joining", i.e. using a table/list of DB1 and a dbjoin pointing to DB2 etc.
 
I don't have multiple connections.

I've searched for "text" element and there is only one in group Messages (look at attachment).

Changing join on with Value = id[raccomended] and Label = id all works!

I don't understand why I can see "text" on dropdown id and dropdown label. Is it a possible bug?

Thanks!
 

Attachments

  • text_field.png
    text_field.png
    42.4 KB · Views: 162
Is possible I did a text column on order and after deleted because I wanted to do on messages so I've deleted the wrong element.

Probably when I delete a list or an element (or rename) a message about the db table must be shown ("Do you want to delete also the related DB column/table?")
 
Ok.
Deleting and/or renaming elements which are already used in joins etc. (and so stored in Fabrik meta data tables) may have side effects.
Maybe not all of these scenarios are catched or there's an "hidden" error message (do you have J! error reporting set to max?)

I assume you are testing (so without real data).
I would suggest to delete the dbjoin element (also remove it from trash), recreate it (it will show then "price" hopefully), recreate the related data.
 
Probably when I delete a list or an element (or rename) a message about the db table must be shown ("Do you want to delete also the related DB column/table?")
First step in Fabrik is "Trash" (which is only setting a state).
If you are doing "Empty trash" on trashed items you are ask if you want to drop DB tables or table columns.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top