Opened 9 years ago
Closed 9 years ago
#6608 closed defect (bug) (fixed)
Groups invite friends input control echoing checked attr
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.4 | Priority: | high |
Severity: | major | Version: | |
Component: | Groups | Keywords: | has-patch |
Cc: |
Description (last modified by )
In trunk bp-groups-templates.php L: 4957 we are currently echoing the checked()
function when selecting a name to invite checked="checked"
checked() being an echo function!
This is introduced by way of changes to using the checked() function rather than passing in a variable as before; in changeset r9939
checked() takes two mandatory? args and a third optional $echo true/false we need to pass that third arg if using this function so patch re-writes the $checked variable to hold the name ID if in array or else empty it and updates checked to carry $checked against the inputs value and ads 'false' to prevent echoing.
Attachments (3)
Change History (9)
#2
@
9 years ago
The second parameter of checked()
defaults to true
. We don't gain anything by passing a string instead.
It looks like checked( $checked, true, false )
is the best smallest change to fix the issue this ticket covers.
RE: the label
element you added in the patch and didn't mention: while this part of code has a number of stylistic and standards issues that I would probably change if I were writing this today, let's keep fixes and improvements separate. :)
#3
@
9 years ago
hmm the intention was to separate the notion of the label element fix from the other ticket hence creating this ticket and removing the checked fix from the other patch, shouldn't have then updated this patch from the fixed label one I guess :(
second parameter of checked() defaults to true
Ah ok so it just needed to be stated even though a default to allow the third param to be set, cool!
Well this patch can be cleaned back to pre label update to keep things clearer.
@
9 years ago
Updated patch removes the label enhancements from 6605 ticket - just includesthe checked fix
#4
@
9 years ago
I can't get valid results from changing the second param on checked() so have left it at my implementation unless someone else wants to do something better.
Update use of checked() function for invite name input control