Skip to content
This repository was archived by the owner on Mar 29, 2019. It is now read-only.

Commit a0f1992

Browse files
committed
SMW compat fix
1 parent 3356f26 commit a0f1992

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

SemanticMaps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
return 1;
1717
}
1818

19-
define( 'SM_VERSION', '3.1.2' );
19+
define( 'SM_VERSION', '3.1.3' );
2020

2121
if ( version_compare( $GLOBALS['wgVersion'], '1.19c', '<' ) ) {
2222
throw new Exception( 'This version of Semantic Maps requires MediaWiki 1.18 or above;'

docs/RELEASE-NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
These are the release notes for the Semantic Maps extension.
22

3+
## Semantic Maps 3.1.3
4+
5+
Released on November 11th, 2014.
6+
7+
* Restored compatibility with SMW 2.0.x (broken in SM 3.1.2)
8+
39
## Semantic Maps 3.1.2
410

511
Released on November 11th, 2014.

src/SM_AreaValueDescription.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ class SMAreaValueDescription extends SMWValueDescription {
4141
protected $radius;
4242

4343
/**
44-
* Constructor.
45-
*
46-
* @since 0.6
47-
*
4844
* @param SMWDataItem $areaCenter
4945
* @param string $comparator
5046
* @param string $radius
@@ -65,16 +61,21 @@ public function __construct( SMWDataItem $areaCenter, $comparator, $radius, SMWD
6561
$this->bounds = $this->getBoundingBox();
6662
}
6763

64+
private function getPropertyCompat() {
65+
return method_exists( $this, 'getProperty' ) ? $this->getProperty() : $this->m_property;
66+
}
67+
6868
/**
6969
* @see SMWDescription:getQueryString
7070
*
7171
* @since 0.6
7272
*
73-
* @param Boolean $asValue
73+
* @param boolean $asValue
74+
* @return string
7475
*/
7576
public function getQueryString( $asValue = false ) {
7677
if ( $this->getDataItem() !== null ) {
77-
$queryString = DataValueFactory::newDataItemValue( $this->getDataItem(), $this->getProperty() )->getWikiValue();
78+
$queryString = DataValueFactory::newDataItemValue( $this->getDataItem(), $this->getPropertyCompat() )->getWikiValue();
7879
return $asValue ? $queryString : "[[$queryString]]";
7980
} else {
8081
return $asValue ? '+' : '';

src/SM_GeoCoordsValueDescription.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ class SMGeoCoordsValueDescription extends SMWValueDescription {
1818
* @since 0.6
1919
*
2020
* @param boolean $asValue
21+
* @return string
2122
*/
2223
public function getQueryString( $asValue = false ) {
2324
if ( $this->getDataItem() !== null ) {
24-
$queryString = DataValueFactory::newDataItemValue( $this->getDataItem(), $this->getProperty() )->getWikiValue();
25+
$queryString = DataValueFactory::newDataItemValue( $this->getDataItem(), $this->getPropertyCompat() )->getWikiValue();
2526
return $asValue ? $queryString : "[[$queryString]]";
2627
} else {
2728
return $asValue ? '+' : '';
2829
}
2930
}
31+
32+
private function getPropertyCompat() {
33+
return method_exists( $this, 'getProperty' ) ? $this->getProperty() : $this->m_property;
34+
}
3035

3136
/**
3237
* @see SMWDescription::getSQLCondition

0 commit comments

Comments
 (0)