VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Ventsi Genchev on September 03, 2017, 22:59:05 PM

Title: Ask a question about this product - error validating characters
Post by: Ventsi Genchev on September 03, 2017, 22:59:05 PM
If the limit for asking a product question is a minimum of 50 and a maximum of 2000 characters, it is necessary to enter at least 51 characters to validate the form.
Accordingly, with the maximum number of symbols, the validation of the form is obtained with the 1999 symbols.

The simple solution is the following:
In the administration:
Question minimum length: 49 (minimum symbols minus 1)
Question maximum length: 2001 (maximum symbols plus 1)

root/templates/your_theme/html/com_virtuemart/askquestion/form.php
from:
$min = VmConfig::get('asks_minimum_comment_length', 50);
$max = VmConfig::get('asks_maximum_comment_length', 2000) ;
to:
$min = VmConfig::get('asks_minimum_comment_length', 50) +1;
$max = VmConfig::get('asks_maximum_comment_length', 2000) -1;