Author Topic: VM 3.0.9 and Joomla 3.4.1: unable to add new product to existing order in backend  (Read 3342 times)

level420

  • Beginner
  • *
  • Posts: 12
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

  • Beginner
  • *
  • Posts: 12
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

  • Beginner
  • *
  • Posts: 12
Find attached a patch (diff -Naur) which solves this issue.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Thank you
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

capewellmj

  • Jr. Member
  • **
  • Posts: 93
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

  • Beginner
  • *
  • Posts: 12
I've also encountered that problem. I thought it was due to a false SKU.


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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
WHERE `virtuemart_order_id`=


Seems there is no virtuemart_order_id
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

level420

  • Beginner
  • *
  • Posts: 12
@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


capewellmj

  • Jr. Member
  • **
  • Posts: 93
I agree. How do we fix this?

Thanks :-)

Martin

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
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).
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

  • Jr. Member
  • **
  • Posts: 161
  • Is the stable release stable?
    • SYNTAX ERROR
  • VirtueMart Version: Latest ;)
Click 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 - http://www.syntaxerror.no
Norske nettløsninger og integrasjoner, CONSIGNOR EDI, Mamut ordreimport og produkteksport, kortbetaling og faktura m.m.

Norsk Joomla! - Norwegian Translation Team - http://www.norskjoomla.no

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
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).
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

  • Jr. Member
  • **
  • Posts: 161
  • Is the stable release stable?
    • SYNTAX ERROR
  • VirtueMart Version: Latest ;)
Great Max, will test it tomorrow. Thanks. :)
Rune Rasmussen - http://www.syntaxerror.no
Norske nettløsninger og integrasjoner, CONSIGNOR EDI, Mamut ordreimport og produkteksport, kortbetaling og faktura m.m.

Norsk Joomla! - Norwegian Translation Team - http://www.norskjoomla.no

capewellmj

  • Jr. Member
  • **
  • Posts: 93
I tested. This now works. This update fixed another issue I had too.

Thanks Max