Skip to content

Commit

Permalink
replace deprecated SMWStore::updateDataBefore hook with `SMW::Store…
Browse files Browse the repository at this point in the history
…::BeforeDataUpdateComplete`, CI: AR 1.8.1 → 1.8.2
  • Loading branch information
gesinn-it-gea committed Apr 6, 2023
1 parent bd39624 commit 7dda5fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ EXTENSION := SemanticExtraSpecialProperties

MW_VERSION ?= 1.35
SMW_VERSION ?= 4.1.1
AR_VERSION ?= 1.8.1
AR_VERSION ?= 1.8.2

IMAGE_VERSION := $(MW_VERSION)-$(SMW_VERSION)-$(AR_VERSION)
BUILD_ARGS := \
Expand Down Expand Up @@ -57,7 +57,7 @@ show-logs: .init
.PHONY: .build
.build:
$(show-current-target)
$(compose) build $(BUILD_ARGS) wiki
$(compose) build $(BUILD_ARGS) wiki

.PHONY: .up
.up:
Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This file contains the RELEASE-NOTES of the **Semantic Extra Special Properties*

Unreleased.

* replace deprecated `SMWStore::updateDataBefore` hook with `SMW::Store::BeforeDataUpdateComplete` (gesinn-it-gea)
* added handler for ApprovedRevsRevisionApproved and ApprovedRevsRevisionUnapproved to update the cache (gesinn-it-gea)
* SMW's ApplicationFactory has been renamed to ServicesFactory (gesinn-it-gea)
* Remove "Approved date" property when unapproving (gesinn-it-wam)
Expand Down
6 changes: 2 additions & 4 deletions src/HookRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ private function registerCallbackHandlers( $config ) {
};

/**
* @see https://www.semantic-mediawiki.org/wiki/Hooks/SMWStore::updateDataBefore
* @see https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/technical/hooks/hook.store.beforedataupdatecomplete.md
*/
$this->handlers['SMWStore::updateDataBefore'] = function ( $store, $semanticData ) use ( $appFactory ) {
$this->handlers['SMW::Store::BeforeDataUpdateComplete'] = function ( $store, $semanticData ) use ( $appFactory ) {

$extraPropertyAnnotator = new ExtraPropertyAnnotator(
$appFactory
Expand Down Expand Up @@ -215,8 +215,6 @@ private function registerCallbackHandlers( $config ) {

return true;
};

// 'ApprovedRevsFileRevisionApproved' => [ $this, 'onApprovedRevsFileRevisionApproved' ],
}

}
6 changes: 3 additions & 3 deletions tests/phpunit/Unit/HookRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testInitExtension() {
'___NREV',
'___NTREV',
'___USEREDITCNT',
'___USEREDITCNTNS',
'___USEREDITCNTNS',
'___EXIFDATA',
'___NSID',
'___NSNAME'
Expand Down Expand Up @@ -122,7 +122,7 @@ public function doTestRegisteredAddCustomFixedPropertyTables( $instance ) {
public function doTestRegisteredUpdateDataBeforeHandler( $instance ) {

$this->assertTrue(
$instance->isRegistered( 'SMWStore::updateDataBefore' )
$instance->isRegistered( 'SMW::Store::BeforeDataUpdateComplete' )
);

$store = $this->getMockBuilder( '\SMW\Store' )
Expand All @@ -134,7 +134,7 @@ public function doTestRegisteredUpdateDataBeforeHandler( $instance ) {
->getMock();

$this->assertThatHookIsExcutable(
$instance->getHandlers( 'SMWStore::updateDataBefore' ),
$instance->getHandlers( 'SMW::Store::BeforeDataUpdateComplete' ),
[ $store, $semanticData ]
);
}
Expand Down

0 comments on commit 7dda5fd

Please sign in to comment.