Cascading Dropdown - not populating

Status
Not open for further replies.

pastvne

Bruce Decker
I have a cascading dropdown field that works on F3 but fails on F4 Gamma 1

Plug-in=cascadingdropdown
Group=Subscriptions

Options
hidden=no
Eval=<blank>
Default=<blank>
Data
Render as=Dropdown
Connection=Site Database
List=Document_types
Id=id [Recommended]
Label=Document ID
CONCAT lable=<blank>
Watch
Watch Element=Division Code
Foreign Key=Division Code
Please Select
Show please select=Yes
Please select value=<blank>
Please select label=<blank>
Advanced
Where Query=<blank>
Eval Options =<blank>
Layout
Enhanced Dropdowns=No
Options per row=1
Front end
Read only link = No
Bootstrap size=col-sm-8

Also, when editing the element, on the Data tab, there is a spinner just under the 'List' text box that never goes away.
Tested on Firefox and Chrome
 
I don't think it makes a difference in this case, but recent release is Gamma2.
Do you get JS errors?

Gesendet von meinem SM-G930F mit Tapatalk
 
The spinner below the list selection can be ignored (there are some others we are chasing...).
CDD is working on my site.
So:
Do you get JS errors? (Remember that any warning, notice etc. will break such ajax updates. You'll see a JS error in your browser console and find the original warning in your browser's network response).
Any other special setting, e.g. elements in repeat groups?
 
There are other elements on the form, but no CDDs. No repeat groups, just two normal elements one a database join and the other the CDD plus some other non-related elements. I could try turning off all other elements just for kicks. I do have debug set so I'm seeing a lot of deprecated warnings in the window above the form. Could that be causing issues?

I'm set for another go tomorrow and I'll report here what I find.



You're probably right (of course) Troester. Thanks!
 
Last edited:
Okay, I ran the test and came up with this. It looks like an internal server 500 error perhaps on the ajax callback? I'm not great with Javascript

Code:
mootools-core.js:3614

POST https://cspdevf4.cloxxxx.com/index.php/site-admin/subscriptions/form/11/ 500 (Internal Server Error)

send @ mootools-core.js:3614

e.extend.$owner @ mootools-core.js:787

send @ mootools-more.js:2616

change @ cascadingdropdown.js:216

e.extend.$owner @ mootools-core.js:787

dowatch @ cascadingdropdown.js:59

e.extend.$owner @ mootools-core.js:787

doChange @ cascadingdropdown.js:67

e.extend.$owner @ mootools-core.js:787

m @ mootools-core.js:2540

handleMouseUp_ @ unknown

Looking in my php log for time of that error, I am getting a PHP warning.
Code:
[04-Mar-2023 23:04:31 UTC] PHP Warning:  Undefined variable $data in /home/bluepi20/public_html/sites/cspdevf4.cloudstreetportal.com/tmp/fabrik/FabrikEval_166027484a3fd3dcfc9e5968c23ed425 on line 13

and later i trapped this when I disabled all elements except the watched and the watcher:

Code:
Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    onSuccess https://cspdevf4.cloudstreetportal.com/plugins/fabrik_element/cascadingdropdown/cascadingdropdown.js:131
    fireEvent https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:858
    m https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:121
    each https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:193
    fireEvent https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:857
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    onSuccess https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:3519
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    success https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:3516
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    onStateChange https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:3502
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    send https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:3601
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    send https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-more.js:2616
    change https://cspdevf4.cloudstreetportal.com/plugins/fabrik_element/cascadingdropdown/cascadingdropdown.js:216
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    dowatch https://cspdevf4.cloudstreetportal.com/plugins/fabrik_element/cascadingdropdown/cascadingdropdown.js:59
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    doChange https://cspdevf4.cloudstreetportal.com/plugins/fabrik_element/cascadingdropdown/cascadingdropdown.js:67
    e https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:787
    m https://cspdevf4.cloudstreetportal.com/media/com_fabrik/js/mootools-core.js:2540
 
Last edited:
@troester I've now moved to the Cassiopea template to clear the console of js errors. Still not populating although I have other CDDs on other lists where this same cascade is working. So, I'm going to carefully compare the working CDD properties with the non-working to see if I can spot the cuprit. Will report back when I have something more but I do not suspect the CDD at this point.
 
Are you now running Gamma2 + this $data fix in the CDD from @achartier in your other thread?

CDD not populating can be introduced by some error/warning - typically you'll get this "Uncaught SyntaxError: JSON.parse: unexpected character ...." in the browser console and find the error message itself in the browser network response. It may work again after setting J! error reporting to none.

Or it maybe there are just no matching values (do you have settings in Advanced?).

BTW: I general prefer dbjoin with Ajax update instead of CDD.
 
Thanks @troester I'll try those suggestions. I was not aware that I could do a AJAX update on a dbjoin as an alternative to CDD so I'll also give that a look.

Appreciated as always.
 
I'm not sure what happened but I now have my CDD back. I'm going to have to declare this my mistake in debugging. But in doing so, I found a typo in the CDD plugin that I will submit to the project. Thanks again Troester, for your patience with me.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top