terminal42 / contao-dcawizard

A Contao CMS widget to handle external table records in the edit mode of the parent record.
10 stars 10 forks source link

Wrong "currentRecord" id in mode "editAll" #18

Closed richardhj closed 7 years ago

richardhj commented 8 years ago

You're using the url id parameter for the currentRecord id (see https://github.com/terminal42/contao-dcawizard/blob/master/widgets/DcaWizard.php#L90).

I am using the dcawizard for the extension isotope_simple_stockmanagement. When editing isotope products in the mode "editAll", the url structure is the following:

http://localhost/contao/main.php?do=iso_products&id=5610&act=editAll&fields=1

(In this case I selected variants to edit and 5610 is the id of the variant's parent product). What happens? Instead of loading the correct dcawizard widget for each item, the dcawizard widget of the parent item is generated for all items. But in most cases, the id param is not present in the url at all when editing in the mode editAll and it turns into an error, as the currentRecord can not be set:

Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY tstamp ASC' at line 1 (SELECT * FROM tl_iso_bonus_points WHERE tstamp>0 AND pid= ORDER BY tstamp ASC) 
Toflar commented 8 years ago

This is actually a feature request because editAll support is just not implemented yet.

qzminski commented 7 years ago

That should be fixed in 2.3.5 already.