Incorrect place of field format validation

10 views
Skip to first unread message

Alexander Obuhovich

unread,
Apr 25, 2011, 6:10:34 AM4/25/11
to In-Portal Bugs
In-Portal has ability to validate value in the field using given regular expression (regexp option in field definition).

All works fine, unless you need to change field value (not on form, but in code) before validation takes place.

To solve that problem I'm proposing to move processing of "regexp" option from kFormatter class into kDBItem class.

Dmitry A.

unread,
Apr 25, 2011, 9:26:25 AM4/25/11
to in-port...@googlegroups.com
I agree, this makes more sense to me too.

Do you have a prototype for this (tried) already?


DA

Phil -- wbtc.fr --

unread,
Apr 25, 2011, 10:45:40 AM4/25/11
to in-port...@googlegroups.com
I totally agree too.

May I ask... how to use regexp actually? :)

2011/4/25 Dmitry A. <dand...@gmail.com>
I agree, this makes more sense to me too.

Do you have a prototype for this (tried) already?


DA

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Alexander Obuhovich

unread,
Apr 25, 2011, 10:56:47 AM4/25/11
to in-port...@googlegroups.com
This option is specified in unit config file, like "core/units/users/users_config.php" in "Fields" array, e.g.

'Fields' => Array (
'Login' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'regexp' => '/^user.*$/', 'default' => ''),
),

This will force all new users to have "user" in front of their login name to be entered before registration could continue.

Phil -- wbtc.fr --

unread,
Apr 25, 2011, 11:37:25 AM4/25/11
to in-port...@googlegroups.com
ok. Do this task would be related to this discussion?

2011/4/25 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Apr 25, 2011, 12:13:08 PM4/25/11
to in-port...@googlegroups.com
Yes it's kind of related.

Dmitry A.

unread,
Apr 26, 2011, 9:18:52 PM4/26/11
to in-port...@googlegroups.com
Hi Alex,


Would you please create a task with description what we are moving and where.


Thanks.

Alexander Obuhovich

unread,
May 4, 2011, 4:26:22 PM5/4/11
to in-port...@googlegroups.com
Here is the task: http://tracker.in-portal.org/view.php?id=1047


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.
Reply all
Reply to author
Forward
0 new messages