Skip to content

Commit e2f648c

Browse files
authored
SMW 2.4 compat for TableChangeOp::getFixedPropertyValueBy
1 parent eae6a81 commit e2f648c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/ChangeNotification/ChangeNotificationFilter.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ public function hasChangeToNotifyAbout( CompositePropertyTableDiffIterator $comp
145145

146146
// Skip the Modification date
147147
if (
148-
( $tableChangeOp->getFixedPropertyValueBy( 'key' ) === '_MDAT' ) ||
149-
( $tableChangeOp->getFixedPropertyValueBy( 'key' ) === '_REDI' ) ) {
148+
( $this->getFixedPropertyValueBy( $tableChangeOp, 'key' ) === '_MDAT' ) ||
149+
( $this->getFixedPropertyValueBy( $tableChangeOp, 'key' ) === '_REDI' ) ) {
150150
continue;
151151
}
152152

@@ -168,17 +168,22 @@ public function hasChangeToNotifyAbout( CompositePropertyTableDiffIterator $comp
168168
return $this->canNotify;
169169
}
170170

171+
// 2.4 compat
172+
private function getFixedPropertyValueBy( $tableChangeOp, $key ) {
173+
return method_exists( $tableChangeOp, 'getFixedPropertyValueFor' ) ? $tableChangeOp->getFixedPropertyValueFor( $key ) : $tableChangeOp->getFixedPropertyValueBy( $key );
174+
}
175+
171176
private function doFilterOnFieldChangeOps( $property, $tableChangeOp, $fieldChangeOps ) {
172177

173178
foreach ( $fieldChangeOps as $fieldChangeOp ) {
174179

175180
// _INST is special since the p_id doesn't play a role
176181
// in determining the category page involved
177182
if ( $tableChangeOp->isFixedPropertyOp() ) {
178-
if ( $tableChangeOp->getFixedPropertyValueBy( 'key' ) === '_INST' ) {
183+
if ( $this->getFixedPropertyValueBy( $tableChangeOp, 'key' ) === '_INST' ) {
179184
$fieldChangeOp->set( 'p_id', $fieldChangeOp->get( 'o_id' ) );
180185
} else {
181-
$fieldChangeOp->set( 'p_id', $tableChangeOp->getFixedPropertyValueBy( 'p_id' ) );
186+
$fieldChangeOp->set( 'p_id', $this->getFixedPropertyValueBy( $tableChangeOp, 'p_id' ) );
182187
}
183188
}
184189

0 commit comments

Comments
 (0)