VM 3.0.9 and Joomla 3.4.1: unable to add new product to existing order in backend

Started by level420, June 03, 2015, 11:22:56 AM

Previous topic - Next topic

level420

Hello All!

Running Virtuemart 3.0.9 and Joomla 3.4.1.

If I try to add a new product to an existing order via the "New" button below the existing product lines, the page scrolls to top and nothing happens.

A view into the browser console (here Chrome 43) shows the following error message:


Uncaught TypeError: row.contains is not a function
addNewLine @ index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=15:1610
onclick @ index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=15:1345


Any help would be great.
Regards
Dietrich

level420

Some investigation reveals, that the cause of the problem is within line 70 of file administrator/components/com_virtuemart/views/orders/tmpl/order.php where a string is searched for the occurence aof another string using method contains, which per eg. http://ericleads.com/2013/10/javascript-string-contains/ is part of ECMAScript 6 specifications which seems not be implemented fully in Chrome (but maybe in other browsers).

The link above shows how to create a polyfill, implementing the method to non ECMAScript 6 browsers.

But I think it should be avoided to use not yead fully supported interfaces and use indexOf instead here.


level420


Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

capewellmj

When I try to add a product in the backend it says this:

An error has occurred.
1064 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 '' at line 1 SQL=UPDATE `table_virtuemart_orders` SET `order_shipment`=0.00,`order_shipment_tax`=0.00000 WHERE `virtuemart_order_id`=

Joomla 3.4.1 VM 3.0.9

What does it mean?


level420

I've also encountered that problem. I thought it was due to a false SKU.


Quote from: capewellmj on June 03, 2015, 20:07:37 PM
When I try to add a product in the backend it says this:

An error has occurred.
1064 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 '' at line 1 SQL=UPDATE `table_virtuemart_orders` SET `order_shipment`=0.00,`order_shipment_tax`=0.00000 WHERE `virtuemart_order_id`=

Joomla 3.4.1 VM 3.0.9

What does it mean?



Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

level420

@Milbo: yes, it seems that there is no virtuemart_order_id. But why is this?

When I click on "New" the first order line is simply copied and the copy is appended to the product list of the order. This includes all settings the order line number ( the # column ), the product name and the SKU, simply all column values.

I then click "Edit" and change one of the lines with the product I want to add to the order. I first change the SKU to an existing one, change the name of the product and then click "Save".

After clicking "Save" the described occurs appears.

So I think this should be considered a bug.

What I think should happen visually is:

After click on "New": create a new order line in edit mode using a new order pos number (#) which does not exist yet and remove the existing values for name, sku, product price etc.

After entering new product data, where SKU and quantity should be enough as all other data can be retreived from the database, clicking on "Save" well should save the newly added product and recalculate the needed order values.

Or how is this supposed to work?

ATM it does NOT work.

Any Ideas?
Regards
Dietrich



Milbo

You clicked new and then edit. This is "wrong". Click just new and edit it.... Or click edit and edit it. But not new, then edit to edit it (yeh I know sounds weird).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

Quote from: Milbo on June 08, 2015, 18:14:14 PMClick just new and edit it....

Max, this doesn't work. At least not in J2.5.28 and VM3.0.9 and the patch above.
When clicking new it ads a copy of the last product, and it's not editable...

Have you tested this lately yourself? If yes, in what versions and setup?
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Milbo

Thanks for pushing me. There is the reason the thing is called vm3.0.9 and not 3.0.10. I just tested the edit.... worked, but not the new, did not get an idea, why it should break.

The reason is a change in the storing function, which also triggers the plugins now, so the plugins can now also change the amounts (but most plugins not written for that).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

capewellmj

I tested. This now works. This update fixed another issue I had too.

Thanks Max