VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: JeremyD on February 26, 2019, 15:06:58 PM

Title: Problem with Save and Save and Close buttons not working after upgrade
Post by: JeremyD on February 26, 2019, 15:06:58 PM
Having problems with none of the Save and Save and close buttons working in the VM backend following a VM update from VirtueMart 3.2.14 to VirtueMart 3.4.2, and a subsequent retry to VirtueMart 3.4.3 10005

When clicked, buttons change colour, but no action takes place. Happens when trying to edit Categories, Products or Configuration, so presumably throughout VM admin.

Console shows error as:

Uncaught ReferenceError: myValidator is not defined
    at Object.Joomla.submitbutton (index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=214:1927)
    at HTMLButtonElement.onclick (index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=214:551)

Joomla version is 3.9.3
Php version 7.1.23

Admin template is Isis, and I've tried using Hathor with same result.

I'm assuming either a missing script, or a script conflict but could use a steer where to look.

Any thoughts?

Thanks

Jeremy
Title: Re: Problem with Save and Save and Close buttons not working after upgrade
Post by: jenkinhill on February 26, 2019, 15:48:35 PM
Works OK for me. I wonder if there is an installation issue, so try a simple re-install of com_virtuemart.3.4.3.10005.zip   (I assume you are working on a backup of a live site and not on the live site itself...)
Title: Re: Problem with Save and Save and Close buttons not working after upgrade
Post by: JeremyD on February 26, 2019, 17:04:33 PM
Already tried re-installing. I originally ran the update to 3.4.2, then when I encountered the issue, downloaded com_virtuemart.3.4.3.10005.zip and installed that over the top. Didn't make any difference.

It must be specific to this installation, as I'm sure others would be reporting the same problem if it was a common thing. But I just can't see why!

I did receive a warning during the install:

JFolder: :delete: Path is not a folder. Path: /home/[path hidden]/administrator/components/com_virtuemart_allinone/libraries
JFolder: :delete: Path is not a folder. Path: /home/[path hidden]/administrator/components/com_virtuemart_allinone/plugins
JFolder: :delete: Path is not a folder. Path: /home/[path hidden]/administrator/components/com_virtuemart_allinone/modules
JFolder: :delete: Path is not a folder. Path: /home/[path hidden]/administrator/components/com_virtuemart_allinone/modulesBE

But I don't think that's relevant - I think this is part of the post-install cleanup? And the files do all appear to be correct.

PS: And yes, definitely working on a backup! :-)
Title: Re: Problem with Save and Save and Close buttons not working after upgrade
Post by: GJC Web Design on February 26, 2019, 17:56:05 PM
I have seen this before and from memory was to do with the JCE editor ( if u have it installed) - remove the js compression in the config (JCE)

otherwise esp. in Chrome have experienced this after an upgrade but hard clearing the browser cache fixed it
Title: Re: Problem with Save and Save and Close buttons not working after upgrade
Post by: JeremyD on February 26, 2019, 19:51:58 PM
Yeah, I've run across that issue with JCE before, but not for quite a while. But I've just checked that compression is off (it is) and doesn't seem to make any difference. And I can't see how that would be affecting the VM save buttons, even on pages where the editor isn't loaded.

I don't think it's browser caching - I normally use Opera, which is Chrome driven, but I've even tried using Edge, because I never normally do, and know there can't be anything cached in it! :-)

It seems to be something to do with a call to a validation script, which is why I mostly suspect a conflict somewhere.
Title: Re: Problem with Save and Save and Close buttons not working after upgrade
Post by: GJC Web Design on February 26, 2019, 20:35:26 PM
myValidator is used in the administrator\components\com_virtuemart\helpers\vmviewadmin.php

function addJsJoomlaSubmitButton($validate=false)

         if($validate){
            vmJsApi::vmValidator();
            $form = "if( (a=='apply' || a=='save') && myValidator(form,false)){
            form.submit();
         } else if(a!='apply' && a!='save'){
            form.submit();
         }";
         } else {
            $form = "form.submit();";
         }


are u loading successfully  components/com_virtuemart/assets/js/jquery.validationEngine.js?vmver=xxxxxx ?

and components/com_virtuemart/assets/js/vmvalidator.js?vmver=xxxxxx  - used by the vmValidator function
Title: Re: Problem with Save and Save and Close buttons not working after upgrade
Post by: JeremyD on February 26, 2019, 20:49:33 PM
OK. Firstly thanks for your replies, especially @GJC Web Design - you were on the right lines

I've now tracked down the issue - although the site uses the default theme, it uses a custom sprite for icons, and other images. Consequently the general assets folder had been changed in the configuration to prevent these being overwritten during an update. But the general assets folder also contains the vmvalidator.js validation script, (amongst others), new to v3.4.x. Manually copying all the new files into the right place fixed things...

Guess I should have spotted this before, but couldn't see it for looking!