jenkins-bot has submitted this change and it was merged.
Change subject: registration: Improve error message for non-array attributes
......................................................................
registration: Improve error message for non-array attributes
Change-Id: I7cbf7353ebbbbbbf36500f86164e3b32d7723cca
---
M includes/registration/ExtensionProcessor.php
1 file changed, 5 insertions(+), 4 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/registration/ExtensionProcessor.php
b/includes/registration/ExtensionProcessor.php
index fe9304f..7c60aa5 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -168,12 +168,12 @@
$this->extractCredits( $path, $info );
foreach ( $info as $key => $val ) {
if ( in_array( $key, self::$globalSettings ) ) {
- $this->storeToArray( "wg$key", $val,
$this->globals );
+ $this->storeToArray( $path, "wg$key", $val,
$this->globals );
// Ignore anything that starts with a @
} elseif ( $key[0] !== '@' && !in_array( $key,
self::$notAttributes )
&& !in_array( $key, self::$creditsAttributes )
) {
- $this->storeToArray( $key, $val,
$this->attributes );
+ $this->storeToArray( $path, $key, $val,
$this->attributes );
}
}
}
@@ -367,14 +367,15 @@
}
/**
+ * @param string $path
* @param string $name
* @param array $value
* @param array &$array
* @throws InvalidArgumentException
*/
- protected function storeToArray( $name, $value, &$array ) {
+ protected function storeToArray( $path, $name, $value, &$array ) {
if ( !is_array( $value ) ) {
- throw new InvalidArgumentException( "The value for
'$name' should be an array" );
+ throw new InvalidArgumentException( "The value for
'$name' should be an array (from $path)" );
}
if ( isset( $array[$name] ) ) {
$array[$name] = array_merge_recursive( $array[$name],
$value );
--
To view, visit https://gerrit.wikimedia.org/r/274774
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7cbf7353ebbbbbbf36500f86164e3b32d7723cca
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits