Databasejoin element problems

the site is down for me, guess you using no-ip.org to point to your local machine and you aren't on line at the moment.
However, you're right and I hadn't tested with the join rendered as an auto-complete, and as you say it was not updating the visible field with the selected records label.
I think I have now fixed this in github - if you wouldn't mind updating and testing the changes for me that would be great.
 
I have applied Fabrik-fabrik-3.0.5-332-g7d2b17d

1. in test application (fresh installation with sample tables/data) everything is OK

2. in real application (with existing tables/data), frontend select for auto complete is still NOT working, even after overriding real application files with test application files (not database) and clearing cache! I even install fabrik sample data like I did in test application but nothing.

I will PM rob, real application url to have a look if he has time.
 
Ok, I think I found the problem,

for autocomplete frontend select to work popup form id MUST have the same list id

see file ?plugins\fabrik_element\databasejoin\databasejoin.js?, line 257
if (this.options.popupform === json.formid)

so if you have a fresh installation (with no add/delete lists) everything works fine

BUT in a working environment you certainty will have add/remove lists and forms/lists ids will be out of sync.

In my case forms/lists ids are out of sync (list id for popup is 4 and popup form id is 5) so I can not pass line 257 in databasejoin.js.

I hope there will be a fix for this
 
Ah, that may well be the issue.

We set this.options.popupform to the ID of the form you select in the "popup form'' menu in the join element options, line 1557 of the main databasejoin.php code, in elementjavaScriptOpts():

PHP:
		$popupform = (int)$params->get('databasejoin_popupform');

... which is what get passed in on the options array when the join's JS object is created at page load.

But then in the main list view.html.php that builds the popup for the list selection, we're setting ...

PHP:
		$item = $model->getTable();
...
PHP:
		$this->form = new stdClass();
		$this->form->id = $item->id;

And in the 'dbjoinselect' template, the json.formid is set as the id being passed in on the object creation ...

PHP:
$script = "head.ready(function() {
var trs = new TableRowSelect('".JRequest::getVar('triggerElement') . "', ".(int)$this->form->id.");
});
";

So it's kind of a double problem. First issue is that we're using the form id for popupform from what is really an unrelated feature, i.e. the selection for the "popup form" (for adding new entries). Compounded by the fact that we then use the list ID, not the form associated with the list, for the returned json.formid.

A short term fix would probably be to change ...

PHP:
		$this->form = new stdClass();
		$this->form->id = $item->id;

... to ...

PHP:
		$this->form = new stdClass();
		$this->form->id = $item->form_id;

... which should work, as long as the "popup form" you have selected on the join settings is for the same copy of the list that gets popped up.

I think this change would be "safe", as far as I can tell $this->form->id is only used in that one 'dbjoinselect' template, so it shouldn't have any untoward side effects.

So ... can you test this out for me? Around line 343 in ./components/com_fabrik/views/list/view.html.php, make the change I suggested above, from $list->id to $list->form_id.

And let me know ...

-- hugh
 
Fabrik-fabrik-3.0.5-338-g0e95a57

I changed ./components/com_fabrik/views/list/view.html.php, line 343 to
$this->form->id = $item->form_id;

and?. it fixes ids mismatch

BUT :

1. if popup windows has more than one pages, select works only with first page.
in other pages i get TypeError->"non_object_property_call" in js console (same for render join as dropdown and autocomplete)

2. components\com_fabrik\views\list\tmpl\dbjoinselect\template_css.php is not working.
 
~fiendly dump~

:D


Hugh's out of action at the moment as per the notice at the top of the page. Rob has another project on at the moment as well.

Best bet is to keeping bumping the thread.
 
(Fabrik-fabrik-3.0.5-381-g126dd96.zip)

more problems with databasejoin element (autocomplete + dropdown) :

1. when you click select icon in frontend you get js console message : Resource interpreted as Stylesheet but transferred with MIME type text/html: http://127.0.0.1/test/index.php/com...mplate_css.php?c=3_com_fabrik_3&buttoncount=2

2. frontend ADD is saving data ONLY if you have first click select and returns js error "non_object_property_call"

Problems from prev posts :
3. post #24
4. if you have more than one page in select popup window and you select page 2,3? you get js error "non_object_property_call" and select stops working
5. components\com_fabrik\views\list\tmpl\dbjoinselect \template_css.php is not working.
 
the pagination, then selection issue is fixed in github , the css should also work now

I've also had a look at the add options from the front end, which seems to be working ok now after I had fixed a couple of things.

Could you update and test please?

thx
Rob
 
Sorry for the delay,
I have updated to Fabrik-fabrik-3.0.5-675-g4abf34c.zip and joomla 2.5.6 and :

1. I still have to change file view.base.php , line 315 from $this->form->id = $item->id; to $this->form->id = $item->form_id; so autocomplete frontend select to work. More info in post #24 http://fabrikar.com/forums/showthread.php?t=26090&page=3

2. if I have more than one page in select popup window and I select page 2,3? I get js error "non_object_property_call" in chrome

3. components\com_fabrik\views\list\tmpl\dbjoinselect \template_css.php is not working like in http://fabrikar.com/forums/showthread.php?t=26734
 
I have updated to Fabrik-fabrik-3.0.5-826-g3367d62.zip and :

1. I still have to change line 316 in components\com_fabrik\views\list\view.base.php to make autocomplete work. Do you think that cheesegrits fix from http://fabrikar.com/forums/showthread.php?t=26090&page=3 must not be applied to GitHub ?

2. if I have more than one page in select popup window and I select page 2,3? I get js error "non_object_property_call" in chrome.

3. I fixed my problem with CSS by copying lines 105-141 from components\com_fabrik\views\list\tmpl\dbjoinselect\template_css.php, over to lines 256-281 to components\com_fabrik\views\form\tmpl\labels-above\\template_css.php that I use.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top