News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

SOLVED -Syntax error, unrecognized expression #mprices[product_price_publish_up]

Started by Sicos, March 22, 2015, 19:28:49 PM

Previous topic - Next topic

Sicos

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

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

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

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

Quote from: Sicos on March 23, 2015, 18:46:32 PM
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!

AnSit

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

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 :

        <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

VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

doc_denis

Yes !!   ...Thanks you !


<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

Quote from: Freddo on March 23, 2015, 22:59:04 PM
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 :

        <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.
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

Quote from: Freddo on March 23, 2015, 22:59:04 PM
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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

blizam

Quote from: Milbo on March 24, 2015, 12:27:39 PM
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

Quote from: Milbo on March 24, 2015, 12:27:39 PM
Quote from: Freddo on March 23, 2015, 22:59:04 PM
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.
Joomla! 4.4.5
VirtueMart 4.2.12 11012

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/

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!