#6086 closed defect (bug) (fixed)
bp_get_the_profile_field_is_required filter has nothing to check against.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
We pass in a boolean value, but we don't pass in anything like the current field that could be used to conditionally change the boolean value we return.
From the looks of it, there would potentially be access to the "$field" global but the user would need to know about that and call it themselves in their hook callback.
Attachments (1)
Change History (9)
#1
@
10 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
#2
@
8 years ago
Looked through the file and at least for this one file, these two were the only ones that made sense to need a field id parameter.
#5
@
8 years ago
- Owner set to tw2113
- Status changed from new to assigned
Looks like the patch needs refreshing and the documentation needs updating. Otherwise the change looks good.
Yes, I think this is the reason. A couple considerations:
$field
global is an object, and passing it to the filter by reference (as it would be passed by default) may invite developers to do odd things with it. Not functionally different from directly referencing the global, but it makes it a bit more tempting.$field
global is pretty odd and specific to our loop implementation. IMO we should be discouraging reference to it, because it prevents us from making certain kinds of changes to this icky loop in the future.How about if we pass the field id, and leave it to the devs to fetch the field object using
BP_XProfile_Field
? This would mitigate the issues I've described above.