Page MenuHomePhabricator

Numeric fields with commas causing errors
Open, Needs TriagePublic


Testing simple numeric field entries yields these results:

  1. 1234567 - no error
  2. 123,456 - no error
  3. 1,234,567 = "must be a valid number"

Ran test on both SemForms 2.6 and 2.7 -- same error occurs.
Running SMW on mw 1.21

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:39 AM
bzimport set Reference to bz67339.
Aklapper removed Yaron_Koren as the assignee of this task.Sep 2 2015, 3:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 2 2015, 3:54 PM

Is it text field? Number field is not listed in PageForms ( successor of SMW ).

It would just be a text field containing a number, yes.

Can anyone give me the PageForm syntax i.e. in terms of {{{field|num|input type...}}}

Just something like "{{{field|num}}}" should work.

I am reproducing this issue currently in SpecialPages:CreateForm.

There is no error showing in there.

@Himanshuc3: If you try to reproduce issues you need to explain how you try to reproduce issues, otherwise we all just guess which takes time.
In this case, which exact number(s) you entered to test the behavior.

Q. Is generating form from Special:CreateForm the right way to reproduce the issue?
If not what is the correct way? @Aklapper
Right now every input is validating/passing i.e. not showing any error.

@Himanshuc3 - I probably should have specified this before, but to make the field numeric, you need to associate it in the template with a property of type "Number" (if you're using SMW), or associate it in the template with a Cargo field of type "Integer" (if you're using Cargo).

I can't reproduce this issue. I did following way to reproduce it.
Created a template and assigned it a table which consists a field of type integers using Cargo

and then created a page through a form and gave the above value it produced correctly even integer is taken with multiple commas as shown.

@Rammanojpotla - cool! Maybe this problem got fixed at some point.

If you put in a text string in that field, like "ABC", does it get rejected?

Rammanojpotla added a comment.EditedFeb 7 2018, 3:29 PM

Sorry for above message. I don't know what happened last time but this time if I make change to the same page with multiple commas it is returning me an error and even with string format mentioned above. It is not giving error with one comma but with multiple it raising error there is also an issue with my current page I can't what happened last time
this is the screenshot of table items and their values

and when I entered the "hello from" page provided there I see the following value

The following is screenshot of occurrence of above error

I think the bug is reproduced in above screenshot due to some mismatching with tables local branches I think first two screenshots created was confusing so I kept above message

made a small change looked in the following format

and the page created in following format

can I upload a patch to it?