Author Topic: SOLVED -Syntax error, unrecognized expression #mprices[product_price_publish_up]  (Read 20052 times)

Sicos

  • Beginner
  • *
  • Posts: 13
    • Wanwisawebwinkel.nl
  • VirtueMart Version: 3.0.4
Hi

VirtueMart 3.0.6.2
Joomla 3.4.1
Language Dutch
Transform template

I just made a fresh install with Joomla and Virtuemart. Everything seems to work fine except the adding of new products.
Whenever I try to save a new product I see the following errors in the FireFox console:

Use of getAttributeNode() is deprecated. Use getAttribute() instead. mootools-core.js:108:0
Empty string passed to getElementById(). jquery.min.js:2:0
GET http://www.wanwila59.fiftynine.axc.nl/components/com_jce/editor/tiny_mce/plugins/core/editor_plugin.js [HTTP/1.1 304 Not Modified 42ms]
GET http://www.wanwila59.fiftynine.axc.nl/administrator/index.php [HTTP/1.1 200 OK 632ms]
Empty string passed to getElementById(). jquery.min.js:2:0
Error: Syntax error, unrecognized expression: #mprices[product_price_publish_up][]-lbl jquery.min.js:2:12716
Empty string passed to getElementById().

It seems to be a jQuery error... already tried the external Google jQuery but no luck with that.

Anyone that has an idea how to fix this?
Adding categories works fine.

Greetings,
Kees van Spelde

billynair

  • Beginner
  • *
  • Posts: 14
  • What does HREF mean?!?
I too am getting this error, but it is NOT an update, we just installed VM for the first time last night

Error: Syntax error, unrecognized expression: #mprices[product_price_publish_up][]-lbl
http://www.mywebsite.com/ktr/media/jui/js/jquery.min.js
Line 2

All other Google searches I found returned answers that were not related to me. This one was closest. I am hoping there is a response soon.

--billynair
Kick out before you slap the lip

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 153
    • Barg IT
Same here. I updated today from Joomla 3.4.0 to 3.4.1 and am getting this error when
trying to save a product. With J3.4.0 everything worked fine.

Sicos

  • Beginner
  • *
  • Posts: 13
    • Wanwisawebwinkel.nl
  • VirtueMart Version: 3.0.4
A fix for this problem

Open the file --> /administrator/components/com_virtuemart/views/product/tmpl/product_edit_price.php

Change these lines:

        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][]'); ?>
        </td>
        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][]'); ?>
        </td>

To:

It's on line 144 and 147, make sure that you add the 0 between the brackets... this fixes the problem.

        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][0]'); ?>
        </td>
        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][0]'); ?>
        </td>

Greetings,
Kees van Spelde

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
A fix for this problem

Open the file --> /administrator/components/com_virtuemart/views/product/tmpl/product_edit_price.php

Change these lines:

        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][]'); ?>
        </td>
        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][]'); ?>
        </td>

To:

It's on line 144 and 147, make sure that you add the 0 between the brackets... this fixes the problem.

        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][0]'); ?>
        </td>
        <td  nowrap>
         <?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][0]'); ?>
        </td>

Greetings,
Kees van Spelde

Worked, thanks!

AS

  • Jr. Member
  • **
  • Posts: 52
Also started getting the error(vm3.0.6.2):
Uncaught Error: Syntax error, unrecognized expression: #mprices [product_price_publish_up] [] - lbl

I would like to hear comments from the developers on this issue and how best to fix this problem.

Freddo

  • Beginner
  • *
  • Posts: 14
error because id has to be unique...
the answer in the post before isnt correct because for more prices still gives error

so try changing to :
Code: [Select]
        <td  nowrap>
<?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][]','mprices[product_price_publish_up]-' $this->priceCounter); ?>
        </td>
        <td  nowrap>
<?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][]','mprices[product_price_publish_down]-' $this->priceCounter); ?>
        </td>

Mike J

  • Beginner
  • *
  • Posts: 25
Thanks Sicos and Freddo,

Back in business!

:)
Virtuemart 3.2.8
Joomla 3.8.2
PHP 7.0

doc_denis

  • Beginner
  • *
  • Posts: 34
Yes !!   ...Thanks you !

Code: [Select]
<td  nowrap>
<?php // echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][]'); ?>
<?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][]','mprices[product_price_publish_up]-' $this->priceCounter); ?>
</td>
<td  nowrap>
<?php // echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][]'); ?>
<?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][]','mprices[product_price_publish_down]-' $this->priceCounter); ?>
</td>

french user VM 3.0.6.2 and Joomla 3.4.1

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9649
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
error because id has to be unique...
the answer in the post before isnt correct because for more prices still gives error

so try changing to :
Code: [Select]
        <td  nowrap>
<?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_up'], 'mprices[product_price_publish_up][]','mprices[product_price_publish_up]-' $this->priceCounter); ?>
        </td>
        <td  nowrap>
<?php echo  vmJsApi::jDate ($this->product->allPrices[$this->product->selectedPrice]['product_price_publish_down'], 'mprices[product_price_publish_down][]','mprices[product_price_publish_down]-' $this->priceCounter); ?>
        </td>

Exactly, the provided solution gives an interesting hint where to look for, but it is not really a suitable solution. My problem is also that people do a minor update and suddenly the js is broken. This let me think that a final solution is to provide our own js. But good tip, I just noticed that we use for the id, just the name. So maybe the new js has just a problem with the id name. Going to test with modified id, lets see if it helps.
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: 9649
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
error because id has to be unique...

The id is unique, but thank you very much for the hint, the real problem was the ID of the field, which used as fallback just the name and the new js has problems to handle [] in the id. Please try the attached file (renamed) at /administrator/components/com_virtuemart/helpers
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

blizam

  • Beginner
  • *
  • Posts: 24
The id is unique, but thank you very much for the hint, the real problem was the ID of the field, which used as fallback just the name and the new js has problems to handle [] in the id. Please try the attached file (renamed) at /administrator/components/com_virtuemart/helpers

I was getting the same error and the attached file resolved the issue.

J3.4.1
VM3.0.6.2


TY!

MAD King

  • Jr. Member
  • **
  • Posts: 319
  • VirtueMart Version: Latest
error because id has to be unique...

The id is unique, but thank you very much for the hint, the real problem was the ID of the field, which used as fallback just the name and the new js has problems to handle [] in the id. Please try the attached file (renamed) at /administrator/components/com_virtuemart/helpers

Thank you, file fixed it.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9649
  • 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/

kiro789

  • Beginner
  • *
  • Posts: 28
  • Skype Name: kiro789
Hello,
I have the same problem after Update to Joomla 3.4.1.So we should just download the new version of VM 3 and just install it like fresh VM installation, right? Via extension installer?
Regards!