VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ex3mist on December 12, 2015, 20:43:23 PM

Title: Save failed with the following error: Please enter your name.
Post by: ex3mist on December 12, 2015, 20:43:23 PM
Hello,
Some issue occured with the register form of VM. After I fill all the fields and hit Register, the following message appears: "Save failed with the following error: Please enter your name.". All the required fields are filled, but...
I can't find out if I did anything. I suspect it occured after the last update I made before a week ago, but I'm not sure. Can anyone give an idea what might caused it? Anything to check, some settings?

Joomla! 3.4.5
VirtueMart 3.0.11.4
Title: Re: Save failed with the following error: Please enter your name.
Post by: jenkinhill on December 12, 2015, 23:24:49 PM
Search?
http://forum.virtuemart.net/index.php?topic=131648.0
http://forum.virtuemart.net/index.php?topic=107226.msg452780#msg452780

Test with the latest version  VM3.0.12
Title: Re: Save failed with the following error: Please enter your name.
Post by: ex3mist on December 13, 2015, 12:49:03 PM
Hello jenkinhill,

Yes, you are right that I didn't search enough here in the forum. I've found some old issues regarding this message after searching in Google but as they were old I desided to post a new topic. Anyway.

Before I see your answer I understood that this issue is coming from the "Displayed Name" field being unpublished. I saw in the links you provided that others are also trying not to use it and there were several modifications to the edit_address_userfields.php file offered but unfortunately for older versions of VM. I also downloaded the latest VM package and compared those files from my site and the package - the code in both is absolutely identical.

So, I desided not to update VM for now cause I'm using preinstalled template package and this might affect other functions of the site. But rather wait untill the developer releases an update. And what I did is to look at the other solutions offered for the previous versions and apply it to mine. I edited the edit_address_userfields.php by replasing this code (line 71):


<tr title="<?php echo strip_tags($descr?>">
<td class="key"  >
<label class="<?php echo $field['name'?>" for="<?php echo $field['name'?>_field">
<?php echo $field['title'] . ($field['required'] ? ' *' ''?>
</label>
</td>
<td>
<?php echo $field['formcode'?>
</td>
</tr>


with this one:


<tr title="<?php echo strip_tags($descr?>" <?php if ($field['name']=="name") {echo 'style=display:none;';};?> >
<td class="key"  >
<label class="<?php echo $field['name'?>" for="<?php echo $field['name'?>_field">
<?php echo $field['title'] . ($field['required'] ? ' *' ''?>
</label>
</td>
<td>
<?php echo $field['formcode'?>
</td>
</tr>


And at the end of the file added the following JS:


<script type="text/javascript">
var $j = jQuery.noConflict(); //avoid conflict with other libraries

$j('#username_field').change(function () {             
var reg_user = $j('#username_field').val(); //set username value inside variable
    $j('#name_field').val(reg_user); //assign variable value to name
});
</script>


I don't know PHP and JS, but as far as I understood from the other posts, this sollution fills the "Displayed Name" field with what is written in the "Username" field, and hides it. Of course the "Displayed Name" field must be published in the admin settings.

I continue testing it, but for now it seems to work for me. If you can suggest more appropriate sollution, please, you're welcome. :)

And another thing, obviously using this field makes sense, but in some cases as mine, admins would like to unpublish it and not use it. Why there is not an option to do this - to Publish/Unpublish it without errors being displayed? So that to be able to deside if you want to use it or not.
Title: Re: Save failed with the following error: Please enter your name.
Post by: jenkinhill on December 13, 2015, 14:01:50 PM
Quote
I'm using preinstalled template package and this might affect other functions of the site

But VM3.0.11.4 was not released as a stable version, it was test/development version. Stable versions are even numbered, eg 3.0.12 - which was a security release so is an important update. VM3.0.12.2 will be available soon with more codefixes and updates.

It's your site, so you fix it how you like, as long as it works!
Title: Re: Save failed with the following error: Please enter your name.
Post by: GJC Web Design on December 13, 2015, 14:06:51 PM
and 3.0.12 should me a very minor (but safe making) update for you .. obviously check on a clone first
Title: Re: Save failed with the following error: Please enter your name.
Post by: ex3mist on December 13, 2015, 16:29:30 PM
Quote from: jenkinhill on December 13, 2015, 14:01:50 PM
Quote
I'm using preinstalled template package and this might affect other functions of the site

But VM3.0.11.4 was not released as a stable version, it was test/development version. Stable versions are even numbered, eg 3.0.12 - which was a security release so is an important update. VM3.0.12.2 will be available soon with more codefixes and updates.

It's your site, so you fix it how you like, as long as it works!

Maybe I'll try to see what happens if I do it after you say it is important update.

But about this field, couldn't it be made not required? Of course you can make it not required and unpublish it, but as you get such messages after that, it's kind of obligatory to use it.
Title: Re: Save failed with the following error: Please enter your name.
Post by: ex3mist on December 13, 2015, 16:30:28 PM
Quote from: GJC Web Design on December 13, 2015, 14:06:51 PM
and 3.0.12 should me a very minor (but safe making) update for you .. obviously check on a clone first

Hi GJC Web Design,
Couldn't understand what do you mean?
Title: Re: Save failed with the following error: Please enter your name.
Post by: GJC Web Design on December 13, 2015, 19:38:14 PM
there is very little difference between 3.0.11.4 and 3.0.12 so the upgrade should be painless.. but test on a copy of the site first

re field.. it is required by Joomla so it has to be there.. auto filled and hidden or otherwise..
Title: Re: Save failed with the following error: Please enter your name.
Post by: ex3mist on December 14, 2015, 21:24:10 PM
It works OK as hidden for now.  ;)
Title: Re: Save failed with the following error: Please enter your name.
Post by: ifs-net on July 24, 2016, 06:03:08 AM
Hello,

I have the same problem with VM 3.0.16...
How can I fix that pls ?

npopi.com
Title: Re: Save failed with the following error: Please enter your name.
Post by: GJC Web Design on July 24, 2016, 10:38:50 AM
example? fuller explanation?
Title: Re: Save failed with the following error: Please enter your name.
Post by: ex3mist on July 24, 2016, 16:24:34 PM
Quote from: ifs-net on July 24, 2016, 06:03:08 AM
Hello,

I have the same problem with VM 3.0.16...
How can I fix that pls ?

npopi.com


Hello,
I've explained how I fixed it in the previous posts, isn't that working for you?
Title: Re: Save failed with the following error: Please enter your name.
Post by: ch1vph on July 04, 2017, 20:52:27 PM
Change it to your first name instead! endof