?
Pull Request for # 5624
Referenced as Pull Request for: # 9997 # 9998
avatar aasimali
aasimali
5 Jan 2015

-Validation is required for zero & negative value input,
-If the user enters the negative & zero value accidently in the session lifetime text field, The entire site stops working.
-Displays this message
The most recent request was denied because it contained an invalid security token. Please refresh the page and try again.
-I did everything hard refresh, close & relaunch the browser, etc. but still the problem was same.
-I overcome this issue by changing the value manually in configuration. php file
-So,as an end user,I suggest,Validation is needed.

screen shot 2015-01-05 at 02 36 48

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar aasimali aasimali - open - 5 Jan 2015
avatar jackkum
jackkum - comment - 5 Jan 2015

I can create PR.
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_config/model/form/application.xml#L714

<field
    name="lifetime"
    type="number"
    default="15"
    label="COM_CONFIG_FIELD_SESSION_TIME_LABEL"
    description="COM_CONFIG_FIELD_SESSION_TIME_DESC"
    required="true"
    filter="integer"
    size="6"
    min="5"
    validate="number" />

and add number.php here https://github.com/joomla/joomla-cms/tree/staging/libraries/joomla/form/rule

class JFormRuleNumber extends JFormRule
{
    public function test(SimpleXMLElement $element, $value, $group = null, JRegistry $input = null, JForm $form = null)
    {
        // If the field is empty and not required, the field is valid.
        $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required');

        if (!$required && empty($value))
        {
            return true;
        }

        $min   = isset($element['min']) ? (int)$element['min'] : null;
        $max   = isset($element['max']) ? (int)$element['max'] : null;

        if(!is_null($min) && $min > $value)
        {
            return false;
        }

        if(!is_null($max) && $max < $value)
        {
            return false;
        }

        return true;
    }
}

but that not help without this http://issues.joomla.org/tracker/joomla-cms/4653
it is help, but the error message will not show.

avatar brianteeman brianteeman - change - 14 Jan 2015
Labels Added: ?
avatar NathanHawks
NathanHawks - comment - 16 Apr 2015

@jackkum I don't think he was requesting a message be shown. I think he was saying, that is the error he is shown, after being locked out of the site when the faulty entry is allowed. I believe validation is all @aasimali was asking for, perhaps also with a sane minimum value (because 1 is low enough to be a major hassle for many users; I should think 5 or more would be enough.)

avatar aasimali
aasimali - comment - 17 Apr 2015

@NathanHawks @jackkum
Yes! I'm asking for the validation, Do not allow to enter the zero & negative value in it.
Show an usable message: You can't enter zero & negative value

avatar gunjanpatel gunjanpatel - change - 30 Nov 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-11-30 04:31:23
Closed_By gunjanpatel
Rel_Number 5624
Relation Type Pull Request for
avatar gunjanpatel
gunjanpatel - comment - 30 Nov 2015

Closing as we have code for this issue in #5624


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5619.

avatar joomla-cms-bot joomla-cms-bot - close - 30 Nov 2015
avatar gunjanpatel
gunjanpatel - comment - 30 Nov 2015

Add a Comment

Login with GitHub to post a comment