[buddypress-trac] [BuddyPress Trac] #5731: text/number profile fields not rendered if value == 0
buddypress-trac
noreply at wordpress.org
Thu Jul 24 13:34:33 UTC 2014
#5731: text/number profile fields not rendered if value == 0
--------------------------+-----------------------
Reporter: DJPaul | Owner: djpaul
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 2.1
Component: XProfile | Version: 1.0
Severity: normal | Resolution:
Keywords: needs-patch |
--------------------------+-----------------------
Comment (by boonebgorges):
Thanks, WCUADD.
> what I'm militantly in favour of is to give the developper the
possibility to add its own control routines if needed
This is, in essence, the purpose of the `BP_XProfile_Field_Type` class
that was introduced in BP 2.0. One of the aspects of field types is the
validation regex; see eg line 1469
https://buddypress.trac.wordpress.org/browser/tags/2.0.1/bp-xprofile/bp-
xprofile-classes.php#L1456. If a plugin developer needs a field with a
validation routine that is unlike any of the field types that BP ships
with, she can introduce a new field type using `BP_XProfile_Field_Type`,
with her own regex. Moreover, we provide the ability for plugins to filter
the `is_valid()` check on existing profile fields; see line 2703
https://buddypress.trac.wordpress.org/browser/tags/2.0.1/bp-xprofile/bp-
xprofile-classes.php#L2672. If you have specific ideas for how the
architecture could be more flexible for plugin devs, please do share them.
At the moment, there are bugs in the form-handling code, that are
independent of the field type API and are blocking it from being used
properly in some cases (since the `! empty()` checks are coming before the
field_type is even referenced). My proposal to replace these checks with
`isset()` will effectively let any value pass through the form handler, so
that the field type API can function as designed.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5731#comment:16>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list