Ticket #497 (closed Bug: fixed)

Opened 7 months ago

Last modified 2 months ago

Input name instead of input label in Forge matches() validation

Reported by: Sqter Owned by: Shadowhand
Priority: minor Milestone:
Component: Modules:Forge Version: SVN HEAD
Keywords: forge matches validation Cc:

Description

Validation for matches() function outputs $input->name instead of $input->label.

modules/Forge/libraries/Form_Input.php, line 498, function validate:

$this->errors['matches'] = array($input->name);

proposed fix:

$this->errors['matches'] = array($input->label ? utf8::strtolower($input->label) : $input->name);

Change History

  Changed 7 months ago by Sqter

  • component changed from Core to Modules:Forge

follow-up: ↓ 3   Changed 7 months ago by Shadowhand

No idea why you would want to match against the label and not the name. Your "fix" makes no sense.

in reply to: ↑ 2   Changed 7 months ago by Sqter

Replying to Shadowhand:

No idea why you would want to match against the label and not the name. Your "fix" makes no sense.

I'm not proposing to change the match condition, but just the error message arguments. Here is the change in a bigger context:

before:

if ( ! empty($this->matches))
{
	foreach($this->matches as $input)
	{
		if ($this->value != $input->value)
		{
			// Field does not match
			$this->errors['matches'] = array($input->name);
			break;
		}
	}
}

after:

if ( ! empty($this->matches))
{
	foreach($this->matches as $input)
	{
		if ($this->value != $input->value)
		{
			// Field does not match
			$this->errors['matches'] = array($input->label ? utf8::strtolower($input->label) : $input->name);
			break;
		}
	}
}

  Changed 7 months ago by Shadowhand

  • owner Shadowhand deleted

Ah-ha, ok, now this makes sense. Thanks.

  Changed 3 months ago by Shadowhand

  • owner set to Shadowhand
  • status changed from new to assigned

  Changed 3 months ago by Shadowhand

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from 2.2 to 2.1.3

Fixed in r2983, merged in r2984.

  Changed 2 months ago by anonymous

  • milestone deleted

Milestone 2.1.3 deleted

Note: See TracTickets for help on using tickets.