Defect #1322

Error on project selection with numeric (only) identifier.

Added by Stefan Hühner over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:2008-05-29
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Projects
Target version:0.7.2
Resolution:Fixed Affected version:0.7.1

Description

Hi,

if an identifier is used which only contains numbers, then the selection of an project from the project list does not work because the projects-controller uses the identifier value as an id.

Error occurs in revision 0.7.1 (r1640)

In app/models/project.rb line 137, method self.find:
The param is matched this "/^\d*$/" regex. When it matches, then the param is used to search in the id. So numeric only identifiers do not work, because their value matches this regex.

The validation for the identifier field "/^[a-z0-9\-]*$/" should be extended to force a least one non-numeric character and the issue perhaps noted in the release-notes, as numeric-only identifiers already present in the db must be corrected manually.

Associated revisions

Revision 1473
Added by Jean-Philippe Lang over 9 years ago

Fixed: can not access old projects created with a numeric identifier (#1322).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Target version set to 0.7.2
  • Resolution set to Fixed

if an identifier is used which only contains numbers, then the selection of an project from the project list does not work because the projects-controller uses the identifier value as an id.

Fixed in r1473. If the identifier of a given project is numeric, its id will be used in urls instead.

The validation for the identifier field "/^[a-z0-9\-]*$/" should be extended to force a least one non-numeric character

You can no longer create a project with a numeric identifier.
See source:/trunk/app/models/project.rb@1472#L247

Also available in: Atom PDF