Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/117240
Change subject: new build, cherry pick I5e62345 for ClaimHtmlGenerator ...................................................................... new build, cherry pick I5e62345 for ClaimHtmlGenerator (until we have a nicer solution in master) Bug: 61915 Change-Id: I439cb0fcfae45e7240ea8792a7acd526c7cc454e --- M composer.lock M extensions/Wikibase/repo/Wikibase.i18n.php M extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php M vendor/autoload.php M vendor/composer/autoload_real.php M vendor/composer/installed.json 6 files changed, 44 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/40/117240/1 diff --git a/composer.lock b/composer.lock index c56ef19..50d66a5 100644 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "d9a578a08cd4843013eb843677b20b4c", + "hash": "bbe7166e24cbb04b2274878003aa9248", "packages": [ { "name": "composer/installers", @@ -851,12 +851,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "69eff3f60cd0116e6c78c9052e55877c5b5c9388" + "reference": "9268fb9bf49d217f3c35a6931488ad108dbedd1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/69eff3f60cd0116e6c78c9052e55877c5b5c9388", - "reference": "69eff3f60cd0116e6c78c9052e55877c5b5c9388", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/9268fb9bf49d217f3c35a6931488ad108dbedd1c", + "reference": "9268fb9bf49d217f3c35a6931488ad108dbedd1c", "shasum": "" }, "require": { @@ -915,7 +915,7 @@ "wikibaserepo", "wikidata" ], - "time": "2014-03-05 16:06:26" + "time": "2014-03-06 16:45:54" } ], "packages-dev": [ diff --git a/extensions/Wikibase/repo/Wikibase.i18n.php b/extensions/Wikibase/repo/Wikibase.i18n.php index 55d9595..de8cd20 100644 --- a/extensions/Wikibase/repo/Wikibase.i18n.php +++ b/extensions/Wikibase/repo/Wikibase.i18n.php @@ -93,6 +93,8 @@ 'wikibase-snakview-snaktypeselector-value' => 'custom value', 'wikibase-snakview-snaktypeselector-somevalue' => 'unknown value', 'wikibase-snakview-snaktypeselector-novalue' => 'no value', + 'wikibase-snakformat-invalid-value' => 'Invalid value', + 'wikibase-snakformat-propertynotfound' => 'Property not found', 'wikibase-shortcopyrightwarning' => 'By clicking "$1", you agree to the [[$2|terms of use]], and you irrevocably agree to release your contribution under the $3.', 'wikibase-shortcopyrightwarning-version' => 'wikibase-1', # do not translate or duplicate this message to other languages 'wikibase-copyrighttooltip-acknowledge' => 'I accept these terms for my future edits. Do not show this message again.', @@ -704,6 +706,8 @@ 'wikibase-snakview-snaktypeselector-value' => "Short descriptive title of a 'value' snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning within the user interface. The basic meaning of this option - which is the default when adding a claim - is allowing the user to specify a value.", 'wikibase-snakview-snaktypeselector-somevalue' => "Short descriptive title of a some-value snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning within the user interface. The basic meaning of this option is that a value exists but it is unknown.", 'wikibase-snakview-snaktypeselector-novalue' => "A short descriptive title of a no-value snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning within the user interface. The basic meaning of this option is that no value exists.", + 'wikibase-snakformat-invalid-value' => 'Error message displayed on item page for property value that has an invalid or mismatching property type and cannot be displayed.', + 'wikibase-snakformat-propertynotfound' => 'Error message displayed on item page for snak with a property that cannot be found.', 'wikibase-shortcopyrightwarning' => 'A short copyright warning displayed during editing in the JavaScript UI. The copyright warning is displayed within a tooltip next to the save button. Parameters: diff --git a/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php b/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php index 3e7e254..bf33c83 100644 --- a/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php +++ b/extensions/Wikibase/repo/includes/ClaimHtmlGenerator.php @@ -2,6 +2,7 @@ namespace Wikibase; +use InvalidArgumentException; use DataValues\DataValue; use Wikibase\Lib\FormattingException; use Wikibase\Lib\PropertyNotFoundException; @@ -257,16 +258,36 @@ } /** + * @fixme handle errors more consistently as done in JS UI + * * @param Snak $snak * @return string */ protected function getFormattedSnakValue( $snak ) { try { - return $this->snakFormatter->formatSnak( $snak ); + $formattedSnak = $this->snakFormatter->formatSnak( $snak ); } catch ( FormattingException $ex ) { - return '?'; // XXX: perhaps show error message? + return $this->getInvalidSnakMessage(); } catch ( PropertyNotFoundException $ex ) { - return '?'; // XXX: perhaps show error message? + return $this->getPropertyNotFoundMessage(); + } catch ( InvalidArgumentException $ex ) { + return $this->getInvalidSnakMessage(); } + + return $formattedSnak; + } + + /** + * @return string + */ + private function getInvalidSnakMessage() { + return wfMessage( 'wikibase-snakformat-invalid-value' )->parse(); + } + + /** + * @return string + */ + private function getPropertyNotFoundMessage() { + return wfMessage ( 'wikibase-snakformat-propertynotfound' )->parse(); } } diff --git a/vendor/autoload.php b/vendor/autoload.php index 477c572..1bf365e 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInitdc4de576c90273a1cef218543565da12::getLoader(); +return ComposerAutoloaderInit8829aa6e1988df79eb5b35455a0fa063::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index b8fa57f..a44ee1e 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitdc4de576c90273a1cef218543565da12 +class ComposerAutoloaderInit8829aa6e1988df79eb5b35455a0fa063 { private static $loader; @@ -19,9 +19,9 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitdc4de576c90273a1cef218543565da12', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8829aa6e1988df79eb5b35455a0fa063', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitdc4de576c90273a1cef218543565da12', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8829aa6e1988df79eb5b35455a0fa063', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); @@ -45,14 +45,14 @@ $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequiredc4de576c90273a1cef218543565da12($file); + composerRequire8829aa6e1988df79eb5b35455a0fa063($file); } return $loader; } } -function composerRequiredc4de576c90273a1cef218543565da12($file) +function composerRequire8829aa6e1988df79eb5b35455a0fa063($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index caf4f12..7b660b5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -878,12 +878,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "69eff3f60cd0116e6c78c9052e55877c5b5c9388" + "reference": "9268fb9bf49d217f3c35a6931488ad108dbedd1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/69eff3f60cd0116e6c78c9052e55877c5b5c9388", - "reference": "69eff3f60cd0116e6c78c9052e55877c5b5c9388", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/9268fb9bf49d217f3c35a6931488ad108dbedd1c", + "reference": "9268fb9bf49d217f3c35a6931488ad108dbedd1c", "shasum": "" }, "require": { @@ -902,9 +902,9 @@ "wikibase/data-model": "~0.6.0", "wikibase/easyrdf_lite": "~0.8.1" }, - "time": "2014-03-05 16:06:26", + "time": "2014-03-06 16:45:54", "type": "mediawiki-extension", - "installation-source": "source", + "installation-source": "dist", "autoload": { "files": [ "Wikibase.composer.php" -- To view, visit https://gerrit.wikimedia.org/r/117240 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I439cb0fcfae45e7240ea8792a7acd526c7cc454e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: mw1.23-wmf17 Gerrit-Owner: Aude <aude.w...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits