Lists: Related Data empty even with functional DB-Join

mudshark79

Member
It's been a while but today i was just starting again with beautiful Fabrik to do some Updates on one of my sites and i stumbled upon a problem which occurred already a while back to me and which is still unclear, also searching the forum didn't clear things up:

Under certain circumstances the "related Data" Area of the Data-Tab of a list stays empty and says "No other lists link here", even though a working Left-Join is in order and working properly in the List and Forms. Also, you guessed it, the "Show" and "Add" links in the lists view of the list containing the Join don't show up which greatly cripples the scope of the whole construction

This is what i did in order to mess it up:

- I had a working DB-Join Element and Used it to create a list Join between two lists, which is pretty much standard and worked fine
- to expand the scope of the DB-Join Element to also filter for another DB-Join Element in that same form
i tried the "where" my-sql-clause which didn't work because the raw_value of the dropdown is only readable after the form has fully loaded and so is a bit to late.... also this is the scope of a cascading-dropdown, isn't?
- so i changed the DB-Join Element to Cascading-DD and used this instead to create a new Join on the list
- this worked fine but now the related data links disappeared :(
- i changed it back again (type of element now db-join again and recreated list-join) - the related data is still not visible

It's a pretty straigth-forward 2.5 Joomla-Install and up to date, i just installed the most recent 3.0.9 Fabrik Code ----


Some of you might provide the answer? Any hints greatly appreciated :)
 

Attachments

  • join.PNG
    join.PNG
    10.7 KB · Views: 400
  • related.PNG
    related.PNG
    2.8 KB · Views: 406
Moved from Fabrik2.0 to Fabrik3.0 forum.

To see related data links the "related" list must contain a dbjoin element.
Did you clear all Joomla and browser cache after switching the element to CDD and back to dbjon?
 
No, but i just gave it a try and it didn't change.

2nd thougth: If i stick with the CCD instead of the DB-Join and manage to create the related-data link in the list view for myself somehow, is there any other downside which should keep me from doing so?

Thanks for your quick reply and tidying up my thread :)
 
OK, i got a workaround myself, if anyone is interested - this isn't exactly the same scope but sufficient for most needs, i think:

1. Create a Link-Element in the List that would normally contain the related data-links that are missing if you use a CDD as Join-Element
2. Create a PHP-Plugin in the Form-Configuration of the said List and use following parameters, important (see Screenie also):

"Start of Form Submission"

3. Use Following PHP as Plugin-Code, see the comments (hope you get the idea), uncomment out the "echoes" to see where you're at while saving or applying the form and giving it a try:

PHP:
//create related List-View filtered for id of this entry
 
//echo "<pre>";print_r($formModel->_formData);exit;
 
 
// this is the id we need as a filter value in the list view of the joined list
$abrechnung_id = '{04_abrechnungen___id}';
//echo $abrechnung_id;
 
//this is a optional display-helper value created with a calcelement (see below):
$abrechnung_disp = '{04_abrechnungen___abrechnung}';
//echo $abrechnung_disp;
 
 
 
//creation of the value for the link element, look at the link-text following the index.php, you have to hard-code the list-id into id, find out by trying in the frontend
$dateilink = array("label" => $abrechnung_disp, "link" => "index.php?option=com_fabrik&view=list&listid=24&resetfilters=1&03_zeiten___abrechnung_id_raw=$abrechnung_id");
 
//how do i like my link-text?
print_r($dateilink);
$formModel->updateFormData('04_abrechnungen___zeiten_link_raw',$dateilink);
 
//test on-off switch
//echo "<pre>";print_r($formModel->_formData);exit;

4. Fiddle around with the settings of the link element, so no one including yourself tries to manipulate it by hand,, should also be possible to hide completely but beware, it has to be loaded with the form otherwise the submission-php-code isn't applied!



Optional:
5. Create yourself a calc-element to calc some fancy name out of the form to use it as a link Text (see Screenshot as example) - in my case i get some simple "name" out of the database based on the referring-id of the entry and i add-up some numbers to get some kind of consecutive, unique designator (but this needs some tweak to add some leading zeros, otherwise it will not be too suitable for sorting on this field at higher numbers)

Notice: this whole thing only works while you are editing the entry that gets joined stgh else in some other table - but usually you go through this process at least once while creating such an entry.

Hope someone can use this for himself and stumbles upon this one fine day using the search, i learned this stuff the hard way about 9 month ago (and somehow it is still "there" in my head to use it when needed so progress is possible even for us learining-by-doing-guys) :)

Please feel free to ask me questions if you something is too unclear ... this explanation is very rough as i know.

Regards,

Matthias
 

Attachments

  • display-helper-calc.PNG
    display-helper-calc.PNG
    19 KB · Views: 379
  • form.PNG
    form.PNG
    16.6 KB · Views: 398
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top