[MediaWiki-l] [Cargo] Submitting a patch?

Ed edward.hoo at gmail.com
Sun Dec 6 08:01:01 UTC 2015


Hi all,

I have a small patch to submit.  I got dev access.  However, I'm getting a
"Permission denied (publickey)" error when attempting to clone the core. I
did look at
https://www.mediawiki.org/wiki/Gerrit/Advanced_usage#SSH_and_.22permission_denied_.28publickey.29.22
and
I'm not quite sure what needs doing after doing "ssh-add ~/.ssh/id_rsa"

Do we need to put the fingerprint of the Gerrit server somewhere? How?

Thanks!


Below is the patch, the purpose of which is to have the HOLDS check match
"book", but not "bookworm" when the field that allows for multiple values
is "book".

--- CargoSQLQuery.php.old   2015-12-03 20:28:37.266335782 -0500
+++ CargoSQLQuery.php.new   2015-12-06 02:49:11.726587301 -0500
@@ -556,19 +556,19 @@
                        $fieldName = $virtualField['fieldName'];
                        $tableName = $virtualField['tableName'];

-                       $likePattern1 = "/\b$tableName\.$fieldName(\s*HOLDS
LIKE\s*)/";
+                       $likePattern1 =
"/\b$tableName\.$fieldName".'[^0-9a-zA-Z$_](\s*HOLDS LIKE\s*)/';
                        $foundLikeMatch1 = preg_match( $likePattern1,
$this->mWhereStr, $matches );
                        $foundLikeMatch2 = $foundMatch1 = $foundMatch2 =
false;
                        if ( !$foundLikeMatch1 ) {
-                               $likePattern2 = "/\b$fieldName(\s*HOLDS
LIKE\s*)/";
+                               $likePattern2 =
"/\b$fieldName".'[^0-9a-zA-Z$_](\s*HOLDS LIKE\s*)/';
                                $foundLikeMatch2 = preg_match(
$likePattern2, $this->mWhereStr, $matches );
                        }

                        if ( !$foundLikeMatch1 && !$foundLikeMatch2 ) {
-                               $pattern1 =
"/\b$tableName\.$fieldName(\s*HOLDS\s*)?/";
+                               $pattern1 =
"/\b$tableName\.$fieldName".'[^0-9a-zA-Z$_](\s*HOLDS LIKE\s*)/';
                                $foundMatch1 = preg_match( $pattern1,
$this->mWhereStr, $matches );
                                if ( !$foundMatch1 ) {
-                                       $pattern2 =
"/\b$fieldName(\s*HOLDS\s*)?/";
+                                       $pattern2 =
"/\b$fieldName".'[^0-9a-zA-Z$_](\s*HOLDS LIKE\s*)/';
                                        $foundMatch2 = preg_match(
$pattern2, $this->mWhereStr, $matches );
                                }
                        }

- Ed


More information about the MediaWiki-l mailing list