248 Posts
Giuse
7 years ago
Topic

Hi, I setup a select dynamic cascade on 3 levels and the third one is not working in editing: when adding a new item, everything works fine, I can save the item and looking also at the DB, the fields are stored as requested. Then, I edit the item and while the first 2 fields are correctly shown, the third one is stick on "Select an option", with nothing in the list.

The first field/query query is to choose a product type

SELECT CATS.id AS value, PROD_CAT.product_cat_name_[lang] AS text FROM #__cck_store_form_lpt_product_category AS PROD_CAT INNER JOIN #__categories AS CATS ON PROD_CAT.id=CATS.id

The second field/query is to choose a product vendor (stored in #__content) associated to that product type (using a content type TBV of associations between product types and product vendors):

SELECT TBV.id AS value, VENDOR.title AS text FROM #__cck_store_form_lpt_product_types_by_vendor AS TBV INNER JOIN #__content AS VENDOR ON (VENDOR.id=TBV.product_tbv_vendor) WHERE TBV.product_tbv_type=[parent]

The third field/query is to choose a specific product item in #__content with the selected product vendor&type association, where product vendor is stored in #__content.xreference and product type is stored in #__content.catId:

SELECT PROD.id AS value, PROD.title AS text FROM #__content AS PROD INNER JOIN #__cck_store_form_lpt_product_types_by_vendor AS TBV ON TBV.product_tbv_vendor=PROD.xreference WHERE TBV.id=[parent] AND PROD.catId=TBV.product_tbv_type

Again, when editing, the first field is populated immediately, after a second the second field is populated, the third one is stuck with select an option and nothing shown and nothing to be selected. Note that my #__content table is just 350 items.

A bug of select dynamic field...?
thanks

Giuse

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
2
Level 1

Have you correctly set your cascade behaviours? First one should be set as First, second as In Between and last one as Last. Also check parent settings and Group Identifier and see if there are any JavaScript errors

248 Posts
Giuse
7 years ago
1
Level 2

Hi Klas, yes: behaviors are correct, group identifier is the same, parent seem correct (also everything works for creating an item). How to check for JavaScript errors? Nothing in error.php file of Apache....

thanks

Giuse

248 Posts
Giuse
7 years ago
0
Level 3

Found the problem and sharing here for other users: changing the "Method" from default GET to POST resolved the issue. My deduction is that the query is too long and is truncated by 2048 chars of GET method, but only when editing (I don't know why but adding a new value works).

cheers

Giuse

Get a VIP membership