mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 02:38:16 +00:00
Merge "Fix flags checkboxes broken in recent patch"
This commit is contained in:
commit
20b447f42e
|
@ -578,23 +578,25 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
$message = "abusefilter-edit-$checkboxId";
|
||||
$dbField = "af_$checkboxId";
|
||||
$postVar = 'wpFilter' . ucfirst( $checkboxId );
|
||||
$cbReadOnlyAttrib = [];
|
||||
$localReadOnlyAttrib = [];
|
||||
|
||||
if ( $checkboxId == 'global' && !$this->canEditGlobal() ) {
|
||||
$cbReadOnlyAttrib['disabled'] = 'disabled';
|
||||
$localReadOnlyAttrib['disabled'] = 'disabled';
|
||||
}
|
||||
|
||||
// Set readonly on deleted if the filter isn't disabled
|
||||
if ( $checkboxId == 'deleted' && $row->af_enabled == 1 ) {
|
||||
$cbReadOnlyAttrib['disabled'] = 'disabled';
|
||||
$localReadOnlyAttrib['disabled'] = 'disabled';
|
||||
}
|
||||
|
||||
$readOnly = array_merge( $cbReadOnlyAttrib, $localReadOnlyAttrib );
|
||||
|
||||
$checkbox = Xml::checkLabel(
|
||||
$this->msg( $message )->text(),
|
||||
$postVar,
|
||||
$postVar,
|
||||
isset( $row->$dbField ) ? $row->$dbField : false,
|
||||
$cbReadOnlyAttrib
|
||||
$readOnly
|
||||
);
|
||||
$checkbox = Xml::tags( 'p', null, $checkbox );
|
||||
$flags .= $checkbox;
|
||||
|
|
Loading…
Reference in a new issue