[MediaWiki-commits] [Gerrit] operations/puppet[production]: naggen2: do not order resources alphabetically
Giuseppe Lavagetto has uploaded a new change for review. https://gerrit.wikimedia.org/r/312186 Change subject: naggen2: do not order resources alphabetically .. naggen2: do not order resources alphabetically This is apparently causing some distress to puppetdb servers, and was done mainly to check the output during the migration. Change-Id: I6282de705c3724439444d0cbd574572382d6be57 --- M modules/puppetmaster/files/naggen2 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/86/312186/1 diff --git a/modules/puppetmaster/files/naggen2 b/modules/puppetmaster/files/naggen2 index 734530e..ed5077c 100755 --- a/modules/puppetmaster/files/naggen2 +++ b/modules/puppetmaster/files/naggen2 @@ -137,7 +137,6 @@ ) resources_raw = requests.get(url, params={ 'query': '["=", ["parameter", "ensure"], "present"]', -'order-by': '[{"field": "title"}]' }) return resources_raw.json() -- To view, visit https://gerrit.wikimedia.org/r/312186 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6282de705c3724439444d0cbd574572382d6be57 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: naggen2: do not order resources alphabetically
Giuseppe Lavagetto has submitted this change and it was merged. Change subject: naggen2: do not order resources alphabetically .. naggen2: do not order resources alphabetically This is apparently causing some distress to puppetdb servers, and was done mainly to check the output during the migration. Change-Id: I6282de705c3724439444d0cbd574572382d6be57 --- M modules/puppetmaster/files/naggen2 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Giuseppe Lavagetto: Verified; Looks good to me, approved diff --git a/modules/puppetmaster/files/naggen2 b/modules/puppetmaster/files/naggen2 index 734530e..ed5077c 100755 --- a/modules/puppetmaster/files/naggen2 +++ b/modules/puppetmaster/files/naggen2 @@ -137,7 +137,6 @@ ) resources_raw = requests.get(url, params={ 'query': '["=", ["parameter", "ensure"], "present"]', -'order-by': '[{"field": "title"}]' }) return resources_raw.json() -- To view, visit https://gerrit.wikimedia.org/r/312186 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6282de705c3724439444d0cbd574572382d6be57 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe LavagettoGerrit-Reviewer: Giuseppe Lavagetto ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Resolve conflicts on preferred language.
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312182 Change subject: Resolve conflicts on preferred language. .. Resolve conflicts on preferred language. If the language is the same the 'variant' should not cause a conflict. Bug: T146344 Change-Id: Ia922994e955b40b12b252fff04959c579fa06f64 --- M sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php M sites/all/modules/wmf_civicrm/wmf_civicrm.module 2 files changed, 126 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/82/312182/1 diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php index 1f71ccd..0d464ee 100644 --- a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php +++ b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php @@ -358,6 +358,57 @@ $this->assertEquals(1, $contact['values'][0]['do_not_email']); } + + /** + * Test that a conflict on communication preferences is handled. + * + * @dataProvider getLanguageCombos + */ + public function testBatchMergeConflictPreferredLanguage($dataSet) { +// Can't use api if we are trying to use invalid data. +wmf_civicrm_ensure_language_exists('en'); +wmf_civicrm_ensure_language_exists('en_NZ'); +CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = '{$dataSet['languages'][0]}' WHERE id = $this->contactID"); +CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = '{$dataSet['languages'][1]}' WHERE id = $this->contactID2"); + +$result = $this->callAPISuccess('Job', 'process_batch_merge', array('mode' => 'safe')); +if ($dataSet['is_conflict']) { + $this->assertEquals(1, count($result['values']['skipped'])); +} +else { + $this->assertEquals(1, count($result['values']['merged'])); + $contact = $this->callAPISuccess('Contact', 'get', array( +'id' => $this->contactID, +'sequential' => 1 + )); + $this->assertEquals($dataSet['selected'], $contact['values'][0]['preferred_language']); +} + } + + /** + * Get combinations of languages for comparison. + * + * @return array + */ + public function getLanguageCombos() { +$dataSet = array( + // Choose longer. + array(array('languages' => array('en', 'en_US'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + array(array('languages' => array('en_US', 'en'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + // Choose valid. + array(array('languages' => array('en_XX', 'en_US'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + array(array('languages' => array('en_US', 'en_XX'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + // Chose one with a 'real' label (more valid). + array(array('languages' => array('en_US', 'en_NZ'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + array(array('languages' => array('en_NZ', 'en_US'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + // Chose either - feels like the return on coding any decision making now is negligible. + // Could go for most recent donor but feels like no return on effort. + // we will usually get the most recent donor anyway by default - as it merges higher number to smaller. + array(array('languages' => array('en_GB', 'en_US'), 'is_conflict' => FALSE, 'selected' => 'en_US')), + array(array('languages' => array('en_US', 'en_GB'), 'is_conflict' => FALSE, 'selected' => 'en_GB')) +); +return $dataSet; + } /** * Test that a conflict on casing in first names is handled. * diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index 654f568..a8a939a 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -1277,6 +1277,16 @@ * @return bool */ function wmf_civicrm_check_language_exists($languageAbbreviation) { + $languages = wmf_civicrm_get_valid_languages(); + return !empty($languages[$languageAbbreviation]); +} + +/** + * Get valid languages. + * + * @return array + */ +function wmf_civicrm_get_valid_languages() { static $languages; if (empty($languages)) { $available_options = civicrm_api3('Contact', 'getoptions', array( @@ -1284,8 +1294,9 @@ )); $languages = $available_options['values']; } - return !empty($languages[$languageAbbreviation]); + return $languages; } + /** * Ensure the required option value exists. * @@ -2128,6 +2139,16 @@ continue; } + if (_wmf_civicrm_merge_resolve_preferred_language_conflict( +str_replace('move_', '', $moveField), +$refs['migration_info'][$moveField], +$refs['migration_info']['rows'][$moveField]['other'], +
[MediaWiki-commits] [Gerrit] mediawiki...Timestamp[master]: Add .gitreview
Legoktm has submitted this change and it was merged. Change subject: Add .gitreview .. Add .gitreview Change-Id: Ib0d0a2854669eb1ff0b06cfbd22b4488e280acbe --- A .gitreview 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Legoktm: Verified; Looks good to me, approved diff --git a/.gitreview b/.gitreview new file mode 100644 index 000..4b65f6c --- /dev/null +++ b/.gitreview @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=mediawiki/libs/Timestamp.git +defaultbranch=master +defaultrebase=0 -- To view, visit https://gerrit.wikimedia.org/r/312181 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib0d0a2854669eb1ff0b06cfbd22b4488e280acbe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/libs/Timestamp Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Timestamp[master]: Add .gitreview
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312181 Change subject: Add .gitreview .. Add .gitreview Change-Id: Ib0d0a2854669eb1ff0b06cfbd22b4488e280acbe --- A .gitreview 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/Timestamp refs/changes/81/312181/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 000..4b65f6c --- /dev/null +++ b/.gitreview @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=mediawiki/libs/Timestamp.git +defaultbranch=master +defaultrebase=0 -- To view, visit https://gerrit.wikimedia.org/r/312181 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0d0a2854669eb1ff0b06cfbd22b4488e280acbe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/libs/Timestamp Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use ConvertibleTimestamp::convert() in a few places
jenkins-bot has submitted this change and it was merged. Change subject: Use ConvertibleTimestamp::convert() in a few places .. Use ConvertibleTimestamp::convert() in a few places Change-Id: I9da31cd96fa7afa5cfccbbc204fb446fdb1a3c65 --- M includes/libs/rdbms/database/Database.php M includes/libs/xmp/XMPValidate.php 2 files changed, 4 insertions(+), 10 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index d3c9d57..4f702c1 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -3458,13 +3458,7 @@ return 'infinity'; } - try { - $t = new ConvertibleTimestamp( $expiry ); - - return $t->getTimestamp( $format ); - } catch ( TimestampException $e ) { - return false; - } + return ConvertibleTimestamp::convert( $format, $expiry ); } public function setBigSelects( $value = true ) { diff --git a/includes/libs/xmp/XMPValidate.php b/includes/libs/xmp/XMPValidate.php index aaf6491..31eaa3b 100644 --- a/includes/libs/xmp/XMPValidate.php +++ b/includes/libs/xmp/XMPValidate.php @@ -329,15 +329,15 @@ // We know that if we got to this step, year, month day hour and min must be set // by virtue of regex not failing. - $unix = ( new ConvertibleTimestamp( + $unix = ConvertibleTimestamp::convert( TS_UNIX, $res[1] . $res[2] . $res[3] . $res[4] . $res[5] . $res[6] - ) )->getTimestamp( TS_UNIX ); + ); $offset = intval( substr( $res[7], 1, 2 ) ) * 60 * 60; $offset += intval( substr( $res[7], 4, 2 ) ) * 60; if ( substr( $res[7], 0, 1 ) === '-' ) { $offset = -$offset; } - $val = ( new ConvertibleTimestamp( $unix + $offset ) )->getTimestamp( TS_EXIF ); + $val = ConvertibleTimestamp::convert( TS_EXIF, $unix + $offset ); if ( $stripSeconds ) { // If seconds weren't specified, remove the trailing ':00'. -- To view, visit https://gerrit.wikimedia.org/r/312173 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9da31cd96fa7afa5cfccbbc204fb446fdb1a3c65 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: Set an initial dummy domain in Database::__construct()
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312179 Change subject: Set an initial dummy domain in Database::__construct() .. Set an initial dummy domain in Database::__construct() This avoids errors when LoadBalancer calls getWikiId() in reallyOpenConnection() after a failed connection. Change-Id: Idc3d93ae39be09f2da277df57cdc5a564cb3408d (cherry picked from commit aa9ef623ecdbb74978c3dd27a262dc5c7ee69046) --- M includes/libs/rdbms/database/Database.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/79/312179/1 diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 9b4e4ac..9a040d9 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -274,6 +274,9 @@ // Set initial dummy domain until open() sets the final DB/prefix $this->currentDomain = DatabaseDomain::newUnspecified(); + // Set initial dummy domain until open() sets the final DB/prefix + $this->currentDomain = DatabaseDomain::newUnspecified(); + if ( $user ) { $this->open( $server, $user, $password, $dbName ); } elseif ( $this->requiresDatabaseUser() ) { -- To view, visit https://gerrit.wikimedia.org/r/312179 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc3d93ae39be09f2da277df57cdc5a564cb3408d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.20 Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Actually set errorLogger in Database
jenkins-bot has submitted this change and it was merged. Change subject: Actually set errorLogger in Database .. Actually set errorLogger in Database Change-Id: Icc2e49bcedf5172c1c1fdf8202acc6c1abdbac5b --- M includes/libs/rdbms/database/Database.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index d3c9d57..bc7f63a 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -266,6 +266,7 @@ $this->trxProfiler = $params['trxProfiler']; $this->connLogger = $params['connLogger']; $this->queryLogger = $params['queryLogger']; + $this->errorLogger = $params['errorLogger']; // Set initial dummy domain until open() sets the final DB/prefix $this->currentDomain = DatabaseDomain::newUnspecified(); -- To view, visit https://gerrit.wikimedia.org/r/312177 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc2e49bcedf5172c1c1fdf8202acc6c1abdbac5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: Actually set errorLogger in Database
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312178 Change subject: Actually set errorLogger in Database .. Actually set errorLogger in Database Change-Id: Icc2e49bcedf5172c1c1fdf8202acc6c1abdbac5b --- M includes/libs/rdbms/database/Database.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/78/312178/1 diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 9b4e4ac..7be4ed3 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -270,6 +270,7 @@ $this->trxProfiler = $params['trxProfiler']; $this->connLogger = $params['connLogger']; $this->queryLogger = $params['queryLogger']; + $this->errorLogger = $params['errorLogger']; // Set initial dummy domain until open() sets the final DB/prefix $this->currentDomain = DatabaseDomain::newUnspecified(); -- To view, visit https://gerrit.wikimedia.org/r/312178 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc2e49bcedf5172c1c1fdf8202acc6c1abdbac5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.20 Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Actually set errorLogger in Database
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312177 Change subject: Actually set errorLogger in Database .. Actually set errorLogger in Database Change-Id: Icc2e49bcedf5172c1c1fdf8202acc6c1abdbac5b --- M includes/libs/rdbms/database/Database.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/77/312177/1 diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index d3c9d57..bc7f63a 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -266,6 +266,7 @@ $this->trxProfiler = $params['trxProfiler']; $this->connLogger = $params['connLogger']; $this->queryLogger = $params['queryLogger']; + $this->errorLogger = $params['errorLogger']; // Set initial dummy domain until open() sets the final DB/prefix $this->currentDomain = DatabaseDomain::newUnspecified(); -- To view, visit https://gerrit.wikimedia.org/r/312177 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc2e49bcedf5172c1c1fdf8202acc6c1abdbac5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] Move most MimeMagic code to MimeAnalyzer
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312176 Change subject: [WIP] Move most MimeMagic code to MimeAnalyzer .. [WIP] Move most MimeMagic code to MimeAnalyzer TODO: wfShell* dependency * The later resides in /libs with related files. * Explose MimeAnalyzer as a service. * Keep MimeMagic::singleton() as a b/c alias. No known callers were type hinting on MimeMagic, and all the old MimeMagic methods are still there. Change-Id: Ie2695a52e7a3bcfda9f7fa83659a9ff31b372bc3 --- M autoload.php M includes/Defines.php M includes/MediaWikiServices.php M includes/MimeMagic.php M includes/ServiceWiring.php R includes/libs/mime/IEContentAnalyzer.php A includes/libs/mime/MimeAnalyzer.php R includes/libs/mime/XmlTypeCheck.php A includes/libs/mime/defines.php 9 files changed, 1,300 insertions(+), 1,144 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/312176/1 diff --git a/autoload.php b/autoload.php index efd34ea..f04d916 100644 --- a/autoload.php +++ b/autoload.php @@ -580,7 +580,7 @@ 'IContextSource' => __DIR__ . '/includes/context/IContextSource.php', 'IDBAccessObject' => __DIR__ . '/includes/dao/IDBAccessObject.php', 'IDatabase' => __DIR__ . '/includes/libs/rdbms/database/IDatabase.php', - 'IEContentAnalyzer' => __DIR__ . '/includes/libs/IEContentAnalyzer.php', + 'IEContentAnalyzer' => __DIR__ . '/includes/libs/mime/IEContentAnalyzer.php', 'IEUrlExtension' => __DIR__ . '/includes/libs/IEUrlExtension.php', 'IExpiringStore' => __DIR__ . '/includes/libs/objectcache/IExpiringStore.php', 'IJobSpecification' => __DIR__ . '/includes/jobqueue/JobSpecification.php', @@ -934,6 +934,7 @@ 'MessageSpecifier' => __DIR__ . '/includes/libs/MessageSpecifier.php', 'MigrateFileRepoLayout' => __DIR__ . '/maintenance/migrateFileRepoLayout.php', 'MigrateUserGroup' => __DIR__ . '/maintenance/migrateUserGroup.php', + 'MimeAnalyzer' => __DIR__ . '/includes/libs/mime/MimeAnalyzer.php', 'MimeMagic' => __DIR__ . '/includes/MimeMagic.php', 'MinifyScript' => __DIR__ . '/maintenance/minify.php', 'MostcategoriesPage' => __DIR__ . '/includes/specials/SpecialMostcategories.php', @@ -1572,7 +1573,7 @@ 'XmlDumpWriter' => __DIR__ . '/includes/export/XmlDumpWriter.php', 'XmlJsCode' => __DIR__ . '/includes/Xml.php', 'XmlSelect' => __DIR__ . '/includes/XmlSelect.php', - 'XmlTypeCheck' => __DIR__ . '/includes/libs/XmlTypeCheck.php', + 'XmlTypeCheck' => __DIR__ . '/includes/libs/mime/XmlTypeCheck.php', 'ZhConverter' => __DIR__ . '/languages/classes/LanguageZh.php', 'ZipDirectoryReader' => __DIR__ . '/includes/utils/ZipDirectoryReader.php', 'ZipDirectoryReaderError' => __DIR__ . '/includes/utils/ZipDirectoryReader.php', diff --git a/includes/Defines.php b/includes/Defines.php index 529dfb3..edfa722 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -92,32 +92,7 @@ define( 'CACHE_ACCEL', 3 ); // APC, XCache or WinCache /**@}*/ -/**@{ - * Media types. - * This defines constants for the value returned by File::getMediaType() - */ -// unknown format -define( 'MEDIATYPE_UNKNOWN', 'UNKNOWN' ); -// some bitmap image or image source (like psd, etc). Can't scale up. -define( 'MEDIATYPE_BITMAP', 'BITMAP' ); -// some vector drawing (SVG, WMF, PS, ...) or image source (oo-draw, etc). Can scale up. -define( 'MEDIATYPE_DRAWING', 'DRAWING' ); -// simple audio file (ogg, mp3, wav, midi, whatever) -define( 'MEDIATYPE_AUDIO', 'AUDIO' ); -// simple video file (ogg, mpg, etc; -// no not include formats here that may contain executable sections or scripts!) -define( 'MEDIATYPE_VIDEO', 'VIDEO' ); -// Scriptable Multimedia (flash, advanced video container formats, etc) -define( 'MEDIATYPE_MULTIMEDIA', 'MULTIMEDIA' ); -// Office Documents, Spreadsheets (office formats possibly containing apples, scripts, etc) -define( 'MEDIATYPE_OFFICE', 'OFFICE' ); -// Plain text (possibly containing program code or scripts) -define( 'MEDIATYPE_TEXT', 'TEXT' ); -// binary executable -define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); -// archive file (zip, tar, etc) -define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); -/**@}*/ +require_once __DIR__ . '/libs/mime/defines.php'; /**@{ * Antivirus result codes, for use in $wgAntivirusSetup. diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index b16044e..41c8e37 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -18,6 +18,7 @@ use MediaWiki\Services\ServiceContainer; use MediaWiki\Services\NoSuchServiceException; use MWException; +use MimeAnalyzer; use ObjectCache; use ProxyLookup; use SearchEngine; @@ -532,6 +533,14 @@ /** * @since 1.28 +* @return MimeAnalyzer +*/ + public function
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Add recurring PayPal test
Cdentinger has uploaded a new change for review. https://gerrit.wikimedia.org/r/312175 Change subject: Add recurring PayPal test .. Add recurring PayPal test Also fix a notice about date not being set. And use a foreach loop to run different test docs. Too much? Change-Id: I5b1cb4155928ed801c930cd0bc243c5637e1e7da --- M PaymentProviders/PayPal/Job.php M PaymentProviders/PayPal/PayPalPaymentsAPI.php M PaymentProviders/PayPal/Tests/Data/subscr_payment.json M PaymentProviders/PayPal/Tests/MockPayPalPaymentsAPI.php M PaymentProviders/PayPal/Tests/config_test.yaml M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 6 files changed, 76 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/75/312175/1 diff --git a/PaymentProviders/PayPal/Job.php b/PaymentProviders/PayPal/Job.php index 703f905..040b725 100644 --- a/PaymentProviders/PayPal/Job.php +++ b/PaymentProviders/PayPal/Job.php @@ -50,6 +50,9 @@ foreach ( $request as $key => $val ) { $new_msg->$key = $val; } + // FIXME represent special case as var_map config override? + // will require recurring consumer to accept normalized msg + $new_msg->date = $request['subscr_id']; } else { $map = $this->config->val( 'var_map' ); foreach ( $map as $rx => $tx ) { diff --git a/PaymentProviders/PayPal/PayPalPaymentsAPI.php b/PaymentProviders/PayPal/PayPalPaymentsAPI.php index ec2c6c8..9dac247 100644 --- a/PaymentProviders/PayPal/PayPalPaymentsAPI.php +++ b/PaymentProviders/PayPal/PayPalPaymentsAPI.php @@ -15,8 +15,7 @@ * @return boolean */ function validate( $post_fields ) { - $url = Configuration::getDefaultConfig() - ->val( 'postback-url' ); + $url = Configuration::getDefaultConfig()->val( 'postback-url' ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); diff --git a/PaymentProviders/PayPal/Tests/Data/subscr_payment.json b/PaymentProviders/PayPal/Tests/Data/subscr_payment.json index 1543a13..fd311cd 100644 --- a/PaymentProviders/PayPal/Tests/Data/subscr_payment.json +++ b/PaymentProviders/PayPal/Tests/Data/subscr_payment.json @@ -1,32 +1,36 @@ { -"transaction_subject": "Donation to the Wikimedia Foundation" -"payment_date": "01:00:26 Aug 13, 2016 PDT" -"txn_type": "subscr_payment" -"subscr_id": "S-W" -"last_name": "Doe" -"residence_country": "US" -"item_name": "Donation to the Wikimedia Foundation" -"payment_gross": "10.00" -"mc_currency": "USD" -"business": "nob...@wikimedia.org" -"payment_type": "instant" -"protection_eligibility": "Ineligible" -"verify_sign": "" -"payer_status": "unverified" -"payer_email": "nob...@example.com" -"txn_id": "Y" -"receiver_email": "nob...@wikimedia.org" -"first_name": "John" -"payer_id": "Z" -"receiver_id": "A" -"item_number": "DONATE" -"payment_status": "Completed" -"payment_fee": "0.42" -"mc_fee": "0.42" -"mc_gross": "10.00" -"custom": "" -"charset": "UTF-8" -"notify_version": "3.8" -"ipn_track_id": "8" +"p":"paypal/listener", +"amount":"1.03", +"address_status":"confirmed", +"subscr_date":"16:03:11 Sep 21, 2016 PDT", +"payer_id":"X", +"address_street":"123 False Rd", +"mc_amount":"1.03", +"charset":"UTF-8", +"address_zip":"9", +"first_name":"Bob", +"reattempt":"1", +"address_country_code":"US", +"address_name":"Bob Loblaw", +"notify_version":"3.8", +"subscr_id":"S-X", +"custom":"7373", +"payer_status":"verified", +"business":"nob...@wikimedia.org", +"address_country":"United States", +"address_city":"Springfield", +"verify_sign":"", +"payer_email":"i...@internet.net", +"payer_business_name":"Bob Loblaw", +"last_name":"Loblaw", +"address_state":"CA", +"receiver_email":"nob...@wikimedia.org", +"recurring":"1", +"txn_type":"subscr_signup", +"item_name":"Donation to the Wikimedia Foundation", +"mc_currency":"USD", +"item_number":"DONATE", +"residence_country":"US", +"period3":"1 M", +"ipn_track_id":"XX" } - diff --git a/PaymentProviders/PayPal/Tests/MockPayPalPaymentsAPI.php b/PaymentProviders/PayPal/Tests/MockPayPalPaymentsAPI.php index 74ed15b..1bd83ab 100644 ---
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp
jenkins-bot has submitted this change and it was merged. Change subject: Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp .. Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp Per the dictionary. Change-Id: I3dcef9fb020c8c6764ee073111ed8c032e4c5a63 --- M autoload.php M includes/MWTimestamp.php M includes/libs/rdbms/database/Database.php M includes/libs/rdbms/database/DatabasePostgres.php R includes/libs/time/ConvertibleTimestamp.php M includes/libs/xmp/XMPValidate.php R tests/phpunit/includes/libs/time/ConvertibleTimestampTest.php 7 files changed, 32 insertions(+), 32 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index efd34ea..433f907 100644 --- a/autoload.php +++ b/autoload.php @@ -281,8 +281,8 @@ 'ConvertExtensionToRegistration' => __DIR__ . '/maintenance/convertExtensionToRegistration.php', 'ConvertLinks' => __DIR__ . '/maintenance/convertLinks.php', 'ConvertUserOptions' => __DIR__ . '/maintenance/convertUserOptions.php', - 'ConvertableTimestamp' => __DIR__ . '/includes/libs/time/ConvertableTimestamp.php', 'ConverterRule' => __DIR__ . '/languages/ConverterRule.php', + 'ConvertibleTimestamp' => __DIR__ . '/includes/libs/time/ConvertibleTimestamp.php', 'Cookie' => __DIR__ . '/includes/libs/Cookie.php', 'CookieJar' => __DIR__ . '/includes/libs/CookieJar.php', 'CopyFileBackend' => __DIR__ . '/maintenance/copyFileBackend.php', diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index 201e9b6..c1e5cc4 100644 --- a/includes/MWTimestamp.php +++ b/includes/MWTimestamp.php @@ -28,7 +28,7 @@ * * @since 1.20 */ -class MWTimestamp extends ConvertableTimestamp { +class MWTimestamp extends ConvertibleTimestamp { /** * Get a timestamp instance in GMT * diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 04ce8ab..d3c9d57 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -2972,7 +2972,7 @@ } public function timestamp( $ts = 0 ) { - $t = new ConvertableTimestamp( $ts ); + $t = new ConvertibleTimestamp( $ts ); // Let errors bubble up to avoid putting garbage in the DB return $t->getTimestamp( TS_MW ); } @@ -3459,7 +3459,7 @@ } try { - $t = new ConvertableTimestamp( $expiry ); + $t = new ConvertibleTimestamp( $expiry ); return $t->getTimestamp( $format ); } catch ( TimestampException $e ) { diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 69488af..8c73a15 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -860,7 +860,7 @@ } function timestamp( $ts = 0 ) { - $ct = new ConvertableTimestamp( $ts ); + $ct = new ConvertibleTimestamp( $ts ); return $ct->getTimestamp( TS_POSTGRES ); } diff --git a/includes/libs/time/ConvertableTimestamp.php b/includes/libs/time/ConvertibleTimestamp.php similarity index 97% rename from includes/libs/time/ConvertableTimestamp.php rename to includes/libs/time/ConvertibleTimestamp.php index a784dc6..7cada84 100644 --- a/includes/libs/time/ConvertableTimestamp.php +++ b/includes/libs/time/ConvertibleTimestamp.php @@ -28,7 +28,7 @@ * * @since 1.28 */ -class ConvertableTimestamp { +class ConvertibleTimestamp { /** * Standard gmdate() formats for the different timestamp types. */ @@ -226,11 +226,11 @@ /** * Calculate the difference between two ConvertableTimestamp objects. * -* @param ConvertableTimestamp $relativeTo Base time to calculate difference from +* @param ConvertibleTimestamp $relativeTo Base time to calculate difference from * @return DateInterval|bool The DateInterval object representing the * difference between the two dates or false on failure */ - public function diff( ConvertableTimestamp $relativeTo ) { + public function diff( ConvertibleTimestamp $relativeTo ) { return $this->timestamp->diff( $relativeTo->timestamp ); } diff --git a/includes/libs/xmp/XMPValidate.php b/includes/libs/xmp/XMPValidate.php index 32a3340..aaf6491 100644 --- a/includes/libs/xmp/XMPValidate.php +++ b/includes/libs/xmp/XMPValidate.php @@ -329,7 +329,7 @@ // We know that if we got to this step, year, month day hour and min must be set // by virtue of regex not failing. -
[MediaWiki-commits] [Gerrit] operations...apertium-swe[master]: Fix typo in changelog
KartikMistry has uploaded a new change for review. https://gerrit.wikimedia.org/r/312174 Change subject: Fix typo in changelog .. Fix typo in changelog Change-Id: I918eaad97b6110ae9e4b6c1bd592eb6d6bffa6a8 --- M debian/changelog 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/apertium-swe refs/changes/74/312174/1 diff --git a/debian/changelog b/debian/changelog index 639c39c..23cc08a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -apertium-swe (0.7.0~r69513-1+wmf1) jessie-wikimedia; kurgency=low +apertium-swe (0.7.0~r69513-1+wmf1) jessie-wikimedia; urgency=low * Rebuild for Jessie. - -- Kartik MistryTue, 14 Jun 2016 10:13:14 +0530 + -- Kartik Mistry Thu, 22 Sep 2016 10:30:40 +0530 apertium-swe (0.7.0~r69513-1) unstable; urgency=low -- To view, visit https://gerrit.wikimedia.org/r/312174 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I918eaad97b6110ae9e4b6c1bd592eb6d6bffa6a8 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/contenttranslation/apertium-swe Gerrit-Branch: master Gerrit-Owner: KartikMistry ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add table prefix in new MySQL tableExists()
Anomie has uploaded a new change for review. https://gerrit.wikimedia.org/r/312018 Change subject: Add table prefix in new MySQL tableExists() .. Add table prefix in new MySQL tableExists() Bug: T146289 Change-Id: If73907f69471a6a91e1db7131a57439f950c5d8c --- M includes/libs/rdbms/database/DatabaseMysqlBase.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/18/312018/1 diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 7abfb17..39cf5bc 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -519,6 +519,7 @@ } function tableExists( $table, $fname = __METHOD__ ) { + $table = $this->tableName( $table, 'raw' ); $encLike = $this->buildLike( $table ); return $this->query( "SHOW TABLES $encLike", $fname )->numRows() > 0; -- To view, visit https://gerrit.wikimedia.org/r/312018 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If73907f69471a6a91e1db7131a57439f950c5d8c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Anomie___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use ConvertibleTimestamp::convert() in a few places
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312173 Change subject: Use ConvertibleTimestamp::convert() in a few places .. Use ConvertibleTimestamp::convert() in a few places Change-Id: I9da31cd96fa7afa5cfccbbc204fb446fdb1a3c65 --- M includes/libs/rdbms/database/Database.php M includes/libs/xmp/XMPValidate.php 2 files changed, 4 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/73/312173/1 diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index d3c9d57..4f702c1 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -3458,13 +3458,7 @@ return 'infinity'; } - try { - $t = new ConvertibleTimestamp( $expiry ); - - return $t->getTimestamp( $format ); - } catch ( TimestampException $e ) { - return false; - } + return ConvertibleTimestamp::convert( $format, $expiry ); } public function setBigSelects( $value = true ) { diff --git a/includes/libs/xmp/XMPValidate.php b/includes/libs/xmp/XMPValidate.php index aaf6491..31eaa3b 100644 --- a/includes/libs/xmp/XMPValidate.php +++ b/includes/libs/xmp/XMPValidate.php @@ -329,15 +329,15 @@ // We know that if we got to this step, year, month day hour and min must be set // by virtue of regex not failing. - $unix = ( new ConvertibleTimestamp( + $unix = ConvertibleTimestamp::convert( TS_UNIX, $res[1] . $res[2] . $res[3] . $res[4] . $res[5] . $res[6] - ) )->getTimestamp( TS_UNIX ); + ); $offset = intval( substr( $res[7], 1, 2 ) ) * 60 * 60; $offset += intval( substr( $res[7], 4, 2 ) ) * 60; if ( substr( $res[7], 0, 1 ) === '-' ) { $offset = -$offset; } - $val = ( new ConvertibleTimestamp( $unix + $offset ) )->getTimestamp( TS_EXIF ); + $val = ConvertibleTimestamp::convert( TS_EXIF, $unix + $offset ); if ( $stripSeconds ) { // If seconds weren't specified, remove the trailing ':00'. -- To view, visit https://gerrit.wikimedia.org/r/312173 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9da31cd96fa7afa5cfccbbc204fb446fdb1a3c65 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312172 Change subject: Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp .. Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp Per the dictionary. Change-Id: I3dcef9fb020c8c6764ee073111ed8c032e4c5a63 --- M autoload.php M includes/MWTimestamp.php M includes/libs/rdbms/database/Database.php M includes/libs/rdbms/database/DatabasePostgres.php R includes/libs/time/ConvertibleTimestamp.php M includes/libs/xmp/XMPValidate.php R tests/phpunit/includes/libs/time/ConvertibleTimestampTest.php 7 files changed, 32 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/312172/1 diff --git a/autoload.php b/autoload.php index efd34ea..433f907 100644 --- a/autoload.php +++ b/autoload.php @@ -281,8 +281,8 @@ 'ConvertExtensionToRegistration' => __DIR__ . '/maintenance/convertExtensionToRegistration.php', 'ConvertLinks' => __DIR__ . '/maintenance/convertLinks.php', 'ConvertUserOptions' => __DIR__ . '/maintenance/convertUserOptions.php', - 'ConvertableTimestamp' => __DIR__ . '/includes/libs/time/ConvertableTimestamp.php', 'ConverterRule' => __DIR__ . '/languages/ConverterRule.php', + 'ConvertibleTimestamp' => __DIR__ . '/includes/libs/time/ConvertibleTimestamp.php', 'Cookie' => __DIR__ . '/includes/libs/Cookie.php', 'CookieJar' => __DIR__ . '/includes/libs/CookieJar.php', 'CopyFileBackend' => __DIR__ . '/maintenance/copyFileBackend.php', diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index 201e9b6..c1e5cc4 100644 --- a/includes/MWTimestamp.php +++ b/includes/MWTimestamp.php @@ -28,7 +28,7 @@ * * @since 1.20 */ -class MWTimestamp extends ConvertableTimestamp { +class MWTimestamp extends ConvertibleTimestamp { /** * Get a timestamp instance in GMT * diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 04ce8ab..d3c9d57 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -2972,7 +2972,7 @@ } public function timestamp( $ts = 0 ) { - $t = new ConvertableTimestamp( $ts ); + $t = new ConvertibleTimestamp( $ts ); // Let errors bubble up to avoid putting garbage in the DB return $t->getTimestamp( TS_MW ); } @@ -3459,7 +3459,7 @@ } try { - $t = new ConvertableTimestamp( $expiry ); + $t = new ConvertibleTimestamp( $expiry ); return $t->getTimestamp( $format ); } catch ( TimestampException $e ) { diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 69488af..8c73a15 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -860,7 +860,7 @@ } function timestamp( $ts = 0 ) { - $ct = new ConvertableTimestamp( $ts ); + $ct = new ConvertibleTimestamp( $ts ); return $ct->getTimestamp( TS_POSTGRES ); } diff --git a/includes/libs/time/ConvertableTimestamp.php b/includes/libs/time/ConvertibleTimestamp.php similarity index 97% rename from includes/libs/time/ConvertableTimestamp.php rename to includes/libs/time/ConvertibleTimestamp.php index a784dc6..7cada84 100644 --- a/includes/libs/time/ConvertableTimestamp.php +++ b/includes/libs/time/ConvertibleTimestamp.php @@ -28,7 +28,7 @@ * * @since 1.28 */ -class ConvertableTimestamp { +class ConvertibleTimestamp { /** * Standard gmdate() formats for the different timestamp types. */ @@ -226,11 +226,11 @@ /** * Calculate the difference between two ConvertableTimestamp objects. * -* @param ConvertableTimestamp $relativeTo Base time to calculate difference from +* @param ConvertibleTimestamp $relativeTo Base time to calculate difference from * @return DateInterval|bool The DateInterval object representing the * difference between the two dates or false on failure */ - public function diff( ConvertableTimestamp $relativeTo ) { + public function diff( ConvertibleTimestamp $relativeTo ) { return $this->timestamp->diff( $relativeTo->timestamp ); } diff --git a/includes/libs/xmp/XMPValidate.php b/includes/libs/xmp/XMPValidate.php index 32a3340..aaf6491 100644 --- a/includes/libs/xmp/XMPValidate.php +++ b/includes/libs/xmp/XMPValidate.php @@ -329,7 +329,7 @@ // We know that if we got to this step, year, month day hour and min must be set // by virtue of regex not failing. -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: time: Implement ConvertableTimestamp::now()
jenkins-bot has submitted this change and it was merged. Change subject: time: Implement ConvertableTimestamp::now() .. time: Implement ConvertableTimestamp::now() Shortcut for ConvertableTimestamp::convert() for the current time. Change-Id: I1c34c0a59bb57652c7a2e959836c8ba400a25f49 --- M includes/GlobalFunctions.php M includes/libs/time/ConvertableTimestamp.php 2 files changed, 11 insertions(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0360d19..6e8ce8f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2033,7 +2033,7 @@ */ function wfTimestampNow() { # return NOW - return MWTimestamp::convert( TS_MW, time() ); + return MWTimestamp::now( TS_MW ); } /** diff --git a/includes/libs/time/ConvertableTimestamp.php b/includes/libs/time/ConvertableTimestamp.php index a4c79ba..a784dc6 100644 --- a/includes/libs/time/ConvertableTimestamp.php +++ b/includes/libs/time/ConvertableTimestamp.php @@ -178,6 +178,16 @@ } /** +* Get the current time in the given format +* +* @param int $style Constant Output format for timestamp +* @return string +*/ + public static function now( $style = TS_MW ) { + return static::convert( $style, time() ); + } + + /** * Get the timestamp represented by this object in a certain form. * * Convert the internal timestamp to the specified format and then -- To view, visit https://gerrit.wikimedia.org/r/312167 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c34c0a59bb57652c7a2e959836c8ba400a25f49 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add deprecated comment to Article::doEdit()
jenkins-bot has submitted this change and it was merged. Change subject: Add deprecated comment to Article::doEdit() .. Add deprecated comment to Article::doEdit() Already there on WikiPage, but this brings it to the IDEs attention rather than @see Bug: T145736 Change-Id: Ic931f83d15638f2babce22edf14ee8626b8a0266 --- M includes/page/Article.php 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/Article.php b/includes/page/Article.php index ba0a484..6d370b0 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -2109,6 +2109,8 @@ /** * Call to WikiPage function for backwards compatibility. * @see WikiPage::doEdit +* +* @deprecated since 1.21: use doEditContent() instead. */ public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) { ContentHandler::deprecated( __METHOD__, '1.21' ); -- To view, visit https://gerrit.wikimedia.org/r/312098 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic931f83d15638f2babce22edf14ee8626b8a0266 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: ReedyGerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Only unregister WT string handler in WT handler factory
jenkins-bot has submitted this change and it was merged. Change subject: Only unregister WT string handler in WT handler factory .. Only unregister WT string handler in WT handler factory Bug: T144653 Change-Id: I91528b56ac3905a05e8da51455055537958e026e --- M modules/ve-mw/ce/ve.ce.MWWikitextSurface.js M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Alex Monk: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/ce/ve.ce.MWWikitextSurface.js b/modules/ve-mw/ce/ve.ce.MWWikitextSurface.js index d0f65f4..d6e612b 100644 --- a/modules/ve-mw/ce/ve.ce.MWWikitextSurface.js +++ b/modules/ve-mw/ce/ve.ce.MWWikitextSurface.js @@ -67,5 +67,3 @@ } ); } }; - -ve.ui.dataTransferHandlerFactory.unregister( ve.ui.MWWikitextStringTransferHandler ); diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js index 7243527..0a2609a 100644 --- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js +++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js @@ -65,3 +65,5 @@ /* Initialization */ ve.ui.wikitextDataTransferHandlerFactory = new ve.ui.MWWikitextDataTransferHandlerFactory(); + +ve.ui.wikitextDataTransferHandlerFactory.unregister( ve.ui.MWWikitextStringTransferHandler ); -- To view, visit https://gerrit.wikimedia.org/r/312096 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91528b56ac3905a05e8da51455055537958e026e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-Reviewer: Alex Monk Gerrit-Reviewer: DLynch Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Strip element IDs from HTML generated when wikitext is pasted
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/312170 Change subject: Strip element IDs from HTML generated when wikitext is pasted .. Strip element IDs from HTML generated when wikitext is pasted Bug: T146054 Change-Id: I0013673a9e41ea191ea64f3208a06288efb2ecd3 --- M modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.js 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/70/312170/1 diff --git a/modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.js b/modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.js index 1138852..526b6d3 100644 --- a/modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.js +++ b/modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.js @@ -96,7 +96,7 @@ // Don't immediately chain, as this.parsoidRequest must be abortable this.parsoidRequest.then( function ( response ) { - var htmlDoc, doc, surface; + var htmlDoc, doc, surface, deleteAttrElements, len; if ( ve.getProp( response, 'visualeditor', 'result' ) !== 'success' ) { return failure(); @@ -104,6 +104,11 @@ htmlDoc = ve.createDocumentFromHtml( response.visualeditor.content ); + deleteAttrElements = htmlDoc.querySelectorAll( '[id]' ); + for ( i = 0, len = deleteAttrElements.length; i < len; i++ ) { + deleteAttrElements[i].removeAttribute( 'id' ); + } + // Pass an empty object for the second argument (importRules) so that clipboard mode is used // TODO: Fix that API doc = handler.surface.getModel().getDocument().newFromHtml( htmlDoc, {} ); -- To view, visit https://gerrit.wikimedia.org/r/312170 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0013673a9e41ea191ea64f3208a06288efb2ecd3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: time: Implement ConvertableTimestamp::convert()
jenkins-bot has submitted this change and it was merged. Change subject: time: Implement ConvertableTimestamp::convert() .. time: Implement ConvertableTimestamp::convert() * This method is analogous to wfTimestamp(). Optimise for the common idiom of just converting a timestamp without having the caller hold on to any object. * Make wfTimestamp() use this (it could already since it didn't use any MWTimestamp methods). Use via MWTimestamp. While this is the same as direct access, it allows future changes. * Add tests covering this new method. Change-Id: I7f9104f1701d92fe25d72c7943581c64e1d093fa --- M includes/GlobalFunctions.php M includes/libs/time/ConvertableTimestamp.php M tests/phpunit/includes/libs/time/ConvertableTimestampTest.php 3 files changed, 36 insertions(+), 6 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index e5f518f..0360d19 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2003,13 +2003,11 @@ * @return string|bool String / false The same date in the format specified in $outputtype or false */ function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) { - try { - $timestamp = new MWTimestamp( $ts ); - return $timestamp->getTimestamp( $outputtype ); - } catch ( TimestampException $e ) { + $ret = MWTimestamp::convert( $outputtype, $ts ); + if ( $ret === false ) { wfDebug( "wfTimestamp() fed bogus time value: TYPE=$outputtype; VALUE=$ts\n" ); - return false; } + return $ret; } /** @@ -2035,7 +2033,7 @@ */ function wfTimestampNow() { # return NOW - return wfTimestamp( TS_MW, time() ); + return MWTimestamp::convert( TS_MW, time() ); } /** diff --git a/includes/libs/time/ConvertableTimestamp.php b/includes/libs/time/ConvertableTimestamp.php index af7eca6..a4c79ba 100644 --- a/includes/libs/time/ConvertableTimestamp.php +++ b/includes/libs/time/ConvertableTimestamp.php @@ -162,6 +162,22 @@ } /** +* Convert a timestamp string to a given format. +* +* @param int $style Constant Output format for timestamp +* @param string $ts Timestamp +* @return string|bool Formatted timestamp or false on failure +*/ + public static function convert( $style = TS_UNIX, $ts ) { + try { + $ct = new static( $ts ); + return $ct->getTimestamp( $style ); + } catch ( TimestampException $e ) { + return false; + } + } + + /** * Get the timestamp represented by this object in a certain form. * * Convert the internal timestamp to the specified format and then diff --git a/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php b/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php index 88c2989..986dda4 100644 --- a/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php +++ b/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php @@ -72,6 +72,22 @@ } /** +* @dataProvider provideValidTimestamps +* @covers ConvertableTimestamp::convert +*/ + public function testConvert( $format, $expected, $original ) { + $this->assertSame( $expected, ConvertableTimestamp::convert( $format, $original ) ); + } + + /** +* Format an invalid timestamp. +* @covers ConvertableTimestamp::convert +*/ + public function testConvertInvalid() { + $this->assertSame( false, ConvertableTimestamp::convert( 'Not a timestamp', 0 ) ); + } + + /** * Test an out of range timestamp * @dataProvider provideOutOfRangeTimestamps * @expectedException TimestampException -- To view, visit https://gerrit.wikimedia.org/r/311881 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f9104f1701d92fe25d72c7943581c64e1d093fa Gerrit-PatchSet: 9 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: KrinkleGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Release 0.8.0-alpha.1
jenkins-bot has submitted this change and it was merged. Change subject: Release 0.8.0-alpha.1 .. Release 0.8.0-alpha.1 Change-Id: I98283a2cc45aa99a3b2fab27330268a542b5b8f3 --- M HISTORY.md 1 file changed, 20 insertions(+), 0 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/HISTORY.md b/HISTORY.md index 9ec6699..4be1b21 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,25 @@ # MediaWiki-Codesniffer release history # +## 0.8.0-alpha.1 / 2016-09-21 ## +* Add detection for calling global functions in target classes. (Tao Xie) +* Add function commenting sniff. (Lethexie) +* Add .idea directory to .gitignore (Florian Schmidt) +* Add sniff to confirm function name using lower camel case. (Lethexie) +* Add test to verify SpaceBeforeClassBraceSniff handles extends (Kunal Mehta) +* Add the SpaceBeforeClassBraceSniff (Lethe) +* Add the SpaceBeforeControlStructureBraceSniff (Lethexie) +* Add usage to forbid superglobals like $_GET,$_POST (Lethe) +* Comments should start with new line. (Lethe) +* Disallow parenthesis around keywords like clone or require (Florian) +* Enable PSR2.Methods.FunctionClosingBrace sniff (Kunal Mehta) +* Fix reference parameters warning and no return function need return tag (Lethe) +* Fix single space expected on single line comment. (Lethexie) +* Make sure no empty line at the begin of the function. (Lethexie) +* Put failed examples and passed examples into a file. (Lethexie) +* Report warnings when $dbr->query() is used instead of $dbr->select(). (Tao Xie) +* Single Line comments no multiple '*'. (Lethe) +* Update squizlabs/php_codesniffer to 2.7.0 (Paladox) + ## 0.7.2 / 2016-05-27 ## * SpaceyParenthesisSniff: Don't remove last argument or array element (Kevin Israel) * Expect specific output from sniffs (Erik Bernhardson) -- To view, visit https://gerrit.wikimedia.org/r/312169 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98283a2cc45aa99a3b2fab27330268a542b5b8f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/codesniffer Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Addshore Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Release 0.8.0-alpha.1
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312169 Change subject: Release 0.8.0-alpha.1 .. Release 0.8.0-alpha.1 Change-Id: I98283a2cc45aa99a3b2fab27330268a542b5b8f3 --- M HISTORY.md 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer refs/changes/69/312169/1 diff --git a/HISTORY.md b/HISTORY.md index 9ec6699..4be1b21 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,25 @@ # MediaWiki-Codesniffer release history # +## 0.8.0-alpha.1 / 2016-09-21 ## +* Add detection for calling global functions in target classes. (Tao Xie) +* Add function commenting sniff. (Lethexie) +* Add .idea directory to .gitignore (Florian Schmidt) +* Add sniff to confirm function name using lower camel case. (Lethexie) +* Add test to verify SpaceBeforeClassBraceSniff handles extends (Kunal Mehta) +* Add the SpaceBeforeClassBraceSniff (Lethe) +* Add the SpaceBeforeControlStructureBraceSniff (Lethexie) +* Add usage to forbid superglobals like $_GET,$_POST (Lethe) +* Comments should start with new line. (Lethe) +* Disallow parenthesis around keywords like clone or require (Florian) +* Enable PSR2.Methods.FunctionClosingBrace sniff (Kunal Mehta) +* Fix reference parameters warning and no return function need return tag (Lethe) +* Fix single space expected on single line comment. (Lethexie) +* Make sure no empty line at the begin of the function. (Lethexie) +* Put failed examples and passed examples into a file. (Lethexie) +* Report warnings when $dbr->query() is used instead of $dbr->select(). (Tao Xie) +* Single Line comments no multiple '*'. (Lethe) +* Update squizlabs/php_codesniffer to 2.7.0 (Paladox) + ## 0.7.2 / 2016-05-27 ## * SpaceyParenthesisSniff: Don't remove last argument or array element (Kevin Israel) * Expect specific output from sniffs (Erik Bernhardson) -- To view, visit https://gerrit.wikimedia.org/r/312169 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98283a2cc45aa99a3b2fab27330268a542b5b8f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/codesniffer Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove individual wikis' config for wgOresModels, use 'defau...
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/312168 Change subject: Remove individual wikis' config for wgOresModels, use 'default' instead .. Remove individual wikis' config for wgOresModels, use 'default' instead All wikis that have ORES enabled at all have exactly the same config here. Change-Id: If32d81b09fac60ed3b4a3a97c020316e3e4d --- M wmf-config/InitialiseSettings.php 1 file changed, 2 insertions(+), 50 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/68/312168/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index b27a152..7cc6db3 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17030,58 +17030,10 @@ 'wgOresModels' => [ 'default' => [ 'damaging' => true, - 'reverted' => true, - 'goodfaith' => true, + 'reverted' => false, + 'goodfaith' => false, 'wp10' => false, ], - 'fawiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T130211 - 'wikidatawiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T130212 - 'nlwiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T139432 - 'ruwiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T139541 - 'ptwiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T139692 - 'trwiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T139992 - 'plwiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T140005 - 'enwiki' => [ - 'damaging' => true, - 'reverted' => false, - 'goodfaith' => false, - 'wp10' => false, - ], // T140003 ], 'wgOresDamagingThresholds' => [ 'default' => [ 'hard' => 0.5, 'soft' => 0.7 ], -- To view, visit https://gerrit.wikimedia.org/r/312168 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If32d81b09fac60ed3b4a3a97c020316e3e4d Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move IP class to libs/
jenkins-bot has submitted this change and it was merged. Change subject: Move IP class to libs/ .. Move IP class to libs/ Also fix some misplaced parenthesis in IPTest. Change-Id: I84d6120c49f733ec45e7e0005259871808b7568b --- M autoload.php R includes/libs/IP.php R tests/phpunit/includes/libs/IPTest.php 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index aa0f561..9e5bf04 100644 --- a/autoload.php +++ b/autoload.php @@ -586,7 +586,7 @@ 'IJobSpecification' => __DIR__ . '/includes/jobqueue/JobSpecification.php', 'ILoadBalancer' => __DIR__ . '/includes/libs/rdbms/loadbalancer/ILoadBalancer.php', 'ILoadMonitor' => __DIR__ . '/includes/libs/rdbms/loadmonitor/ILoadMonitor.php', - 'IP' => __DIR__ . '/includes/utils/IP.php', + 'IP' => __DIR__ . '/includes/libs/IP.php', 'IPSet' => __DIR__ . '/includes/compat/IPSetCompat.php', 'IPTC' => __DIR__ . '/includes/media/IPTC.php', 'IRCColourfulRCFeedFormatter' => __DIR__ . '/includes/rcfeed/IRCColourfulRCFeedFormatter.php', diff --git a/includes/utils/IP.php b/includes/libs/IP.php similarity index 100% rename from includes/utils/IP.php rename to includes/libs/IP.php diff --git a/tests/phpunit/includes/utils/IPTest.php b/tests/phpunit/includes/libs/IPTest.php similarity index 98% rename from tests/phpunit/includes/utils/IPTest.php rename to tests/phpunit/includes/libs/IPTest.php index 5e0626b..307652d 100644 --- a/tests/phpunit/includes/utils/IPTest.php +++ b/tests/phpunit/includes/libs/IPTest.php @@ -44,7 +44,7 @@ public function testisIPAddress() { $this->assertTrue( IP::isIPAddress( '::' ), 'RFC 4291 IPv6 Unspecified Address' ); $this->assertTrue( IP::isIPAddress( '::1' ), 'RFC 4291 IPv6 Loopback Address' ); - $this->assertTrue( IP::isIPAddress( '74.24.52.13/20', 'IPv4 range' ) ); + $this->assertTrue( IP::isIPAddress( '74.24.52.13/20' ), 'IPv4 range' ); $this->assertTrue( IP::isIPAddress( 'fc:100:a:d:1:e:ac:0/24' ), 'IPv6 range' ); $this->assertTrue( IP::isIPAddress( 'fc::100:a:d:1:e:ac/96' ), 'IPv6 range with "::"' ); @@ -99,7 +99,7 @@ $this->assertTrue( IP::isIPv6( 'fc::100' ), 'IPv6 with "::" and 2 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a' ), 'IPv6 with "::" and 3 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d', 'IPv6 with "::" and 4 words' ) ); + $this->assertTrue( IP::isIPv6( 'fc::100:a:d' ), 'IPv6 with "::" and 4 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1' ), 'IPv6 with "::" and 5 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e' ), 'IPv6 with "::" and 6 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e:ac' ), 'IPv6 with "::" and 7 words' ); -- To view, visit https://gerrit.wikimedia.org/r/312163 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84d6120c49f733ec45e7e0005259871808b7568b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GlobalUserPage[master]: Remove SkinTemplateNavigationUniversal hook
jenkins-bot has submitted this change and it was merged. Change subject: Remove SkinTemplateNavigationUniversal hook .. Remove SkinTemplateNavigationUniversal hook As of 67d589450e in MediaWiki core, this is no longer needed. Change-Id: I8f45ed0b151d3356754c0cd653163cac9907 --- M GlobalUserPage.hooks.php M extension.json 2 files changed, 1 insertion(+), 28 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/GlobalUserPage.hooks.php b/GlobalUserPage.hooks.php index 1054c06..6883808 100644 --- a/GlobalUserPage.hooks.php +++ b/GlobalUserPage.hooks.php @@ -42,30 +42,6 @@ } /** -* Turn red links into blue in the navigation tabs (Monobook's p-cactions). -* -* @param SkinTemplate $sktemplate -* @param array $links -* @return bool -*/ - public static function onSkinTemplateNavigationUniversal( &$sktemplate, &$links ) { - $title = $sktemplate->getTitle()->getSubjectPage(); // We want the user page - - if ( !$title->exists() && GlobalUserPage::shouldDisplayGlobalPage( $title ) ) { - // Removes ?action=edit=1 - $links['namespaces']['user']['href'] = $title->getFullURL(); - // Remove the "new" class: - // "selected new" --> "selected" - // "new" --> "" - $links['namespaces']['user']['class'] = trim( - str_replace( 'new', '', $links['namespaces']['user']['class'] ) - ); - } - - return true; - } - - /** * Mark global user pages as known so they appear in blue * * @param Title $title title to check diff --git a/extension.json b/extension.json index 69d4549..1fc2d0a 100644 --- a/extension.json +++ b/extension.json @@ -10,7 +10,7 @@ "license-name": "CC0-1.0", "type": "other", "requires": { - "MediaWiki": ">= 1.27.0" + "MediaWiki": ">= 1.28.0" }, "MessagesDirs": { "GlobalUserPage": [ @@ -23,9 +23,6 @@ "Hooks": { "GetPreferences": [ "GlobalUserPageHooks::onGetPreferences" - ], - "SkinTemplateNavigation::Universal": [ - "GlobalUserPageHooks::onSkinTemplateNavigationUniversal" ], "TitleIsAlwaysKnown": [ "GlobalUserPageHooks::onTitleIsAlwaysKnown" -- To view, visit https://gerrit.wikimedia.org/r/310452 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f45ed0b151d3356754c0cd653163cac9907 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GlobalUserPage Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: time: Implement ConvertableTimestamp::now()
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312167 Change subject: time: Implement ConvertableTimestamp::now() .. time: Implement ConvertableTimestamp::now() Shortcut for ConvertableTimestamp::convert() for the current time. Change-Id: I1c34c0a59bb57652c7a2e959836c8ba400a25f49 --- M includes/libs/time/ConvertableTimestamp.php 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/67/312167/1 diff --git a/includes/libs/time/ConvertableTimestamp.php b/includes/libs/time/ConvertableTimestamp.php index a4c79ba..a784dc6 100644 --- a/includes/libs/time/ConvertableTimestamp.php +++ b/includes/libs/time/ConvertableTimestamp.php @@ -178,6 +178,16 @@ } /** +* Get the current time in the given format +* +* @param int $style Constant Output format for timestamp +* @return string +*/ + public static function now( $style = TS_MW ) { + return static::convert( $style, time() ); + } + + /** * Get the timestamp represented by this object in a certain form. * * Convert the internal timestamp to the specified format and then -- To view, visit https://gerrit.wikimedia.org/r/312167 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c34c0a59bb57652c7a2e959836c8ba400a25f49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove MimeMagic depedency from FSFile and move it to /libs
jenkins-bot has submitted this change and it was merged. Change subject: Remove MimeMagic depedency from FSFile and move it to /libs .. Remove MimeMagic depedency from FSFile and move it to /libs Change-Id: Ieaae909b49c798b6e9bed65d15961cefbdaec49b --- M autoload.php M includes/MimeMagic.php M includes/filerepo/FileRepo.php R includes/libs/filebackend/FSFile.php R includes/libs/filebackend/TempFSFile.php M includes/utils/MWFileProps.php 6 files changed, 50 insertions(+), 47 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index cbc079c..e5cecc9 100644 --- a/autoload.php +++ b/autoload.php @@ -432,7 +432,7 @@ 'ExternalStoreHttp' => __DIR__ . '/includes/externalstore/ExternalStoreHttp.php', 'ExternalStoreMedium' => __DIR__ . '/includes/externalstore/ExternalStoreMedium.php', 'ExternalStoreMwstore' => __DIR__ . '/includes/externalstore/ExternalStoreMwstore.php', - 'FSFile' => __DIR__ . '/includes/filebackend/FSFile.php', + 'FSFile' => __DIR__ . '/includes/libs/filebackend/FSFile.php', 'FSFileBackend' => __DIR__ . '/includes/filebackend/FSFileBackend.php', 'FSFileBackendDirList' => __DIR__ . '/includes/filebackend/FSFileBackend.php', 'FSFileBackendFileList' => __DIR__ . '/includes/filebackend/FSFileBackend.php', @@ -1403,7 +1403,7 @@ 'TableDiffFormatter' => __DIR__ . '/includes/diff/TableDiffFormatter.php', 'TablePager' => __DIR__ . '/includes/pager/TablePager.php', 'TagLogFormatter' => __DIR__ . '/includes/logging/TagLogFormatter.php', - 'TempFSFile' => __DIR__ . '/includes/filebackend/TempFSFile.php', + 'TempFSFile' => __DIR__ . '/includes/libs/filebackend/TempFSFile.php', 'TempFileRepo' => __DIR__ . '/includes/filerepo/FileRepo.php', 'TemplateParser' => __DIR__ . '/includes/TemplateParser.php', 'TemplatesOnThisPageFormatter' => __DIR__ . '/includes/TemplatesOnThisPageFormatter.php', diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 5551865..54d58d2 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -863,10 +863,8 @@ $mime = "application/x-opc+zip"; # TODO: remove the block below, as soon as improveTypeFromExtension is used everywhere if ( $ext !== true && $ext !== false ) { - /** This is the mode used by getPropsFromPath -* These MIME's are stored in the database, where we don't really want -* x-opc+zip, because we use it only for internal purposes -*/ + // These MIME's are stored in the database, where we don't really want + // x-opc+zip, because we use it only for internal purposes if ( $this->isMatchingExtension( $ext, $mime ) ) { /* A known file extension for an OPC file, * find the proper mime type for that file extension diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index b5c5bf3..1a6c818 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1540,11 +1540,11 @@ */ public function getFileProps( $virtualUrl ) { $fsFile = $this->getLocalReference( $virtualUrl ); + $mwProps = new MWFileProps( MimeMagic::singleton() ); if ( $fsFile ) { - $mwProps = new MWFileProps( MimeMagic::singleton() ); $props = $mwProps->getPropsFromPath( $fsFile->getPath(), true ); } else { - $props = FSFile::placeholderProps(); + $props = $mwProps->newPlaceholderProps(); } return $props; diff --git a/includes/filebackend/FSFile.php b/includes/libs/filebackend/FSFile.php similarity index 78% rename from includes/filebackend/FSFile.php rename to includes/libs/filebackend/FSFile.php index e7e2608..d0e93da 100644 --- a/includes/filebackend/FSFile.php +++ b/includes/libs/filebackend/FSFile.php @@ -93,18 +93,13 @@ * - fileExists * - size (filesize in bytes) * - mime (as major/minor) -* - media_type (value to be used with the MEDIATYPE_xxx constants) -* - metadata (handler specific) +* - file-mime (as major/minor) * - sha1 (in base 36) -* - width -* - height -* - bits (bitrate) -* - file-mime * - major_mime * - minor_mime * * @param string|bool $ext The file extension, or true to extract it from the filename. -* Set it to
[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: [WIP] Add goodfaith filtering
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/312166 Change subject: [WIP] Add goodfaith filtering .. [WIP] Add goodfaith filtering Need to figure out: * Threshold setting * Wording of interface messages Bug: T137966 Change-Id: I266f6485051f41044f6219a330433737b365a55a --- M i18n/en.json M includes/Hooks.php 2 files changed, 72 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/66/312166/1 diff --git a/i18n/en.json b/i18n/en.json index 891d5b4..a395f6f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -11,8 +11,10 @@ "ores-damaging-soft": "Low (flags fewer edits)", "ores-damaging-title": "This edit needs review", "ores-damaging-legend": "This edit may be damaging and should be reviewed ([[:mw:Special:MyLanguage/ORES review tool|more info]])", + "ores-goodfaith-filter": "$1 probably bad faith edits", "ores-help-damaging-pref": "This threshold determines how sensitive ORES is when flagging edits needing review", "ores-hide-nondamaging-filter": "Only show edits needing review", + "ores-hide-nongoodfaith-filter": "Only show probably good-faith edits", "ores-pref-damaging": "ORES sensitivity", "ores-pref-rc-hidenondamaging": "Hide probably good edits from recent changes", "ores-pref-watchlist-hidenondamaging": "Hide probably good edits from the watchlist", diff --git a/includes/Hooks.php b/includes/Hooks.php index 65744b3..cc66017 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -105,6 +105,13 @@ ]; } + if ( self::isModelEnabled( 'goodfaith' ) ) { + $filters['hidenongoodfaith'] = [ + 'msg' => 'ores-goodfaith-filter', + 'default' => false + ]; + } + return true; } @@ -160,6 +167,31 @@ } } + if ( self::isModelEnabled( 'goodfaith' ) ) { + $threshold = 0.93; // FIXME + $tables['ores_goodfaith_mdl'] = 'ores_model'; + $tables['ores_goodfaith_cls'] = 'ores_classification'; + + $fields['ores_goodfaith_score'] = 'ores_goodfaith_cls.oresc_probability'; + $fields['ores_goodfaith_threshold'] = $dbr->addQuotes( $threshold ); + + $join_conds['ores_goodfaith_mdl'] = [ 'LEFT JOIN', [ + 'ores_goodfaith_mdl.oresm_is_current' => 1, + 'ores_goodfaith_mdl.oresm_name' => 'goodfaith' + ] ]; + $join_conds['ores_goodfaith_cls'] = [ 'LEFT JOIN', [ + 'ores_goodfaith_cls.oresc_model = ores_goodfaith_mdl.oresm_id', + 'rc_this_oldid = ores_goodfaith_cls.oresc_rev', + 'ores_goodfaith_cls.oresc_class' => 1 + ] ]; + + if ( $opts->getValue( 'hidenongoodfaith' ) ) { + // Filter out non-good faith edits + $conds[] = 'ores_goodfaith_cls.oresc_probability > ' . + $dbr->addQuotes( $threshold ); + $filtering = true; + } + } if ( $filtering ) { $conds['rc_patrolled'] = 0; @@ -283,6 +315,30 @@ } } + if ( self::isModelEnabled( 'goodfaith' ) ) { + $threshold = 0.93; // FIXME + $query['tables']['ores_goodfaith_mdl'] = 'ores_model'; + $query['tables']['ores_goodfaith_cls'] = 'ores_classification'; + + $query['fields']['ores_goodfaith_score'] = 'ores_goodfaith_cls.oresc_probability'; + $query['fields']['ores_goodfaith_threshold'] = $dbr->addQuotes( $threshold ); + + $query['join_conds']['ores_goodfaith_mdl'] = [ 'LEFT JOIN', [ + 'ores_goodfaith_mdl.oresm_is_current' => 1, + 'ores_goodfaith_mdl.oresm_name' => 'goodfaith', + ] ]; + + $query['join_conds']['ores_goodfaith_cls'] = [ 'LEFT JOIN', [ + 'ores_goodfaith_cls.oresc_model = ores_goodfaith_mdl.oresm_id', + 'rev_id = ores_goodfaith_cls.oresc_rev', + 'ores_goodfaith_cls.oresc_class' => 1 + ] ]; + + if ( $pager->getContext()->getRequest()->getVal( 'hidenongoodfaith' ) ) { + //
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move IP class to libs/
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312163 Change subject: Move IP class to libs/ .. Move IP class to libs/ Also fix some misplaced parenthesis in IPTest. Change-Id: I84d6120c49f733ec45e7e0005259871808b7568b --- M autoload.php R includes/libs/IP.php R tests/phpunit/includes/libs/IPTest.php 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/63/312163/1 diff --git a/autoload.php b/autoload.php index aa0f561..9e5bf04 100644 --- a/autoload.php +++ b/autoload.php @@ -586,7 +586,7 @@ 'IJobSpecification' => __DIR__ . '/includes/jobqueue/JobSpecification.php', 'ILoadBalancer' => __DIR__ . '/includes/libs/rdbms/loadbalancer/ILoadBalancer.php', 'ILoadMonitor' => __DIR__ . '/includes/libs/rdbms/loadmonitor/ILoadMonitor.php', - 'IP' => __DIR__ . '/includes/utils/IP.php', + 'IP' => __DIR__ . '/includes/libs/IP.php', 'IPSet' => __DIR__ . '/includes/compat/IPSetCompat.php', 'IPTC' => __DIR__ . '/includes/media/IPTC.php', 'IRCColourfulRCFeedFormatter' => __DIR__ . '/includes/rcfeed/IRCColourfulRCFeedFormatter.php', diff --git a/includes/utils/IP.php b/includes/libs/IP.php similarity index 100% rename from includes/utils/IP.php rename to includes/libs/IP.php diff --git a/tests/phpunit/includes/utils/IPTest.php b/tests/phpunit/includes/libs/IPTest.php similarity index 98% rename from tests/phpunit/includes/utils/IPTest.php rename to tests/phpunit/includes/libs/IPTest.php index 5e0626b..307652d 100644 --- a/tests/phpunit/includes/utils/IPTest.php +++ b/tests/phpunit/includes/libs/IPTest.php @@ -44,7 +44,7 @@ public function testisIPAddress() { $this->assertTrue( IP::isIPAddress( '::' ), 'RFC 4291 IPv6 Unspecified Address' ); $this->assertTrue( IP::isIPAddress( '::1' ), 'RFC 4291 IPv6 Loopback Address' ); - $this->assertTrue( IP::isIPAddress( '74.24.52.13/20', 'IPv4 range' ) ); + $this->assertTrue( IP::isIPAddress( '74.24.52.13/20' ), 'IPv4 range' ); $this->assertTrue( IP::isIPAddress( 'fc:100:a:d:1:e:ac:0/24' ), 'IPv6 range' ); $this->assertTrue( IP::isIPAddress( 'fc::100:a:d:1:e:ac/96' ), 'IPv6 range with "::"' ); @@ -99,7 +99,7 @@ $this->assertTrue( IP::isIPv6( 'fc::100' ), 'IPv6 with "::" and 2 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a' ), 'IPv6 with "::" and 3 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d', 'IPv6 with "::" and 4 words' ) ); + $this->assertTrue( IP::isIPv6( 'fc::100:a:d' ), 'IPv6 with "::" and 4 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1' ), 'IPv6 with "::" and 5 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e' ), 'IPv6 with "::" and 6 words' ); $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e:ac' ), 'IPv6 with "::" and 7 words' ); -- To view, visit https://gerrit.wikimedia.org/r/312163 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84d6120c49f733ec45e7e0005259871808b7568b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Use aliases with "damaging" in them so we can add other ones...
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/312164 Change subject: Use aliases with "damaging" in them so we can add other ones (e.g. "goodfaith") .. Use aliases with "damaging" in them so we can add other ones (e.g. "goodfaith") Change-Id: I2f5859c12da50bffab096d9ee9e6fc4bca6d52c4 --- M includes/Hooks.php 1 file changed, 30 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/64/312164/1 diff --git a/includes/Hooks.php b/includes/Hooks.php index ede2dfd..72cf720 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -132,28 +132,27 @@ $threshold = self::getDamagingThreshold( $wgUser ); $dbr = \wfGetDB( DB_REPLICA ); - $tables[] = 'ores_model'; - $tables[] = 'ores_classification'; + $tables['ores_damaging_mdl'] = 'ores_model'; + $tables['ores_damaging_cls'] = 'ores_classification'; - $fields[] = 'oresc_probability'; + $fields['ores_damaging_score'] = 'ores_damaging_cls.oresc_probability'; // Add user-based threshold - $fields[] = $dbr->addQuotes( $threshold ) . ' AS ores_threshold'; + $fields['ores_damaging_threshold'] = $dbr->addQuotes( $threshold ); - $join_conds['ores_model'] = [ 'LEFT JOIN', [ - 'oresm_is_current' => 1, - 'oresm_name' => 'damaging' + $join_conds['ores_damaging_mdl'] = [ 'LEFT JOIN', [ + 'ores_damaging_mdl.oresm_is_current' => 1, + 'ores_damaging_mdl.oresm_name' => 'damaging' ] ]; - $join_conds['ores_classification'] = [ 'LEFT JOIN', [ - 'oresc_model = oresm_id', - 'rc_this_oldid = oresc_rev', - 'oresc_class' => 1 + $join_conds['ores_damaging_cls'] = [ 'LEFT JOIN', [ + 'ores_damaging_cls.oresc_model = ores_damaging_mdl.oresm_id', + 'rc_this_oldid = ores_damaging_cls.oresc_rev', + 'ores_damaging_cls.oresc_class' => 1 ] ]; if ( self::isModelEnabled( 'damaging' ) && $opts->getValue( 'hidenondamaging' ) ) { - // Filter out non-damaging edits. - $conds[] = 'oresc_probability > ' + $conds[] = 'ores_damaging_cls.oresc_probability > ' . $dbr->addQuotes( $threshold ); $conds['rc_patrolled'] = 0; $query_options[] = 'STRAIGHT_JOIN'; @@ -250,27 +249,27 @@ $threshold = self::getDamagingThreshold( $pager->getUser() ); $dbr = \wfGetDB( DB_REPLICA ); - $query['tables'][] = 'ores_model'; - $query['tables'][] = 'ores_classification'; + $query['tables']['ores_damaging_mdl'] = 'ores_model'; + $query['tables']['ores_damaging_cls'] = 'ores_classification'; - $query['fields'][] = 'oresc_probability'; + $query['fields']['ores_damaging_score'] = 'ores_damaging_cls.oresc_probability'; // Add user-based threshold - $query['fields'][] = $dbr->addQuotes( $threshold ) . ' AS ores_threshold'; + $query['fields']['ores_damaging_threshold'] = $dbr->addQuotes( $threshold ); - $query['join_conds']['ores_model'] = [ 'LEFT JOIN', [ - 'oresm_is_current' => 1, - 'oresm_name' => 'damaging', + $query['join_conds']['ores_damaging_mdl'] = [ 'LEFT JOIN', [ + 'ores_damaging_mdl.oresm_is_current' => 1, + 'ores_damaging_mdl.oresm_name' => 'damaging', ] ]; - $query['join_conds']['ores_classification'] = [ 'LEFT JOIN', [ - 'oresc_model = oresm_id', - 'rev_id = oresc_rev', - 'oresc_class' => 1 + $query['join_conds']['ores_damaging_cls'] = [ 'LEFT JOIN', [ + 'ores_damaging_cls.oresc_model = ores_damaging_mdl.oresm_id', + 'rev_id = ores_damaging_cls.oresc_rev', + 'ores_damaging_cls.oresc_class' => 1 ] ]; if ( self::isModelEnabled( 'damaging' ) && $pager->getContext()->getRequest()->getVal( 'hidenondamaging' ) ) { // Filter out non-damaging edits. - $query['conds'][] = 'oresc_probability > ' + $query['conds'][] = 'ores_damaging_cls.oresc_probability > ' . $dbr->addQuotes( $threshold ); } } @@ -283,11 +282,11 @@
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move IP::isConfigured/TrustedProxy() to ProxyLookup service
jenkins-bot has submitted this change and it was merged. Change subject: Move IP::isConfigured/TrustedProxy() to ProxyLookup service .. Move IP::isConfigured/TrustedProxy() to ProxyLookup service This creates a new ProxyLookup service to house the IP::isConfiguredProxy() and IP::isTrustedProxy() functions. The main purpose of this refactoring is to make the IP class entirely independent from MediaWiki, so it can be split into a separate library. Change-Id: I60434a5f3d99880352bc0f72349c33b7d029ae09 --- M RELEASE-NOTES-1.28 M autoload.php M includes/Block.php M includes/MediaWikiServices.php A includes/ProxyLookup.php M includes/ServiceWiring.php M includes/WebRequest.php M includes/utils/IP.php M tests/phpunit/includes/MediaWikiServicesTest.php M tests/phpunit/includes/WebRequestTest.php 10 files changed, 121 insertions(+), 55 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index fd6c613..a24f97a 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -202,6 +202,9 @@ Instead of --keep-uploads, use the same option to parserTests.php, but you must specify a directory with --upload-dir. * The 'jquery.arrowSteps' ResourceLoader module is now deprecated. +* IP::isConfiguredProxy() and IP::isTrustedProxy() were removed. Callers should + migrate to using the same functions on a ProxyLookup instance, obtainable from + MediaWikiServices. == Compatibility == diff --git a/autoload.php b/autoload.php index f5c334b..aa0f561 100644 --- a/autoload.php +++ b/autoload.php @@ -1100,6 +1100,7 @@ 'ProtectedPagesPager' => __DIR__ . '/includes/specials/SpecialProtectedpages.php', 'ProtectedTitlesPager' => __DIR__ . '/includes/specials/pagers/ProtectedTitlesPager.php', 'ProtectionForm' => __DIR__ . '/includes/ProtectionForm.php', + 'ProxyLookup' => __DIR__ . '/includes/ProxyLookup.php', 'PruneFileCache' => __DIR__ . '/maintenance/pruneFileCache.php', 'PublishStashedFileJob' => __DIR__ . '/includes/jobqueue/jobs/PublishStashedFileJob.php', 'PurgeAction' => __DIR__ . '/includes/actions/PurgeAction.php', diff --git a/includes/Block.php b/includes/Block.php index 19ba0a2..098d51c 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -19,6 +19,9 @@ * * @file */ + +use MediaWiki\MediaWikiServices; + class Block { /** @var string */ public $mReason; @@ -1120,6 +1123,7 @@ } $conds = []; + $proxyLookup = MediaWikiServices::getInstance()->getProxyLookup(); foreach ( array_unique( $ipChain ) as $ipaddr ) { # Discard invalid IP addresses. Since XFF can be spoofed and we do not # necessarily trust the header given to us, make sure that we are only @@ -1130,7 +1134,7 @@ continue; } # Don't check trusted IPs (includes local squids which will be in every request) - if ( IP::isTrustedProxy( $ipaddr ) ) { + if ( $proxyLookup->isTrustedProxy( $ipaddr ) ) { continue; } # Check both the original IP (to check against single blocks), as well as build diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index f621867..b16044e 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -19,6 +19,7 @@ use MediaWiki\Services\NoSuchServiceException; use MWException; use ObjectCache; +use ProxyLookup; use SearchEngine; use SearchEngineConfig; use SearchEngineFactory; @@ -531,6 +532,14 @@ /** * @since 1.28 +* @return ProxyLookup +*/ + public function getProxyLookup() { + return $this->getService( 'ProxyLookup' ); + } + + /** +* @since 1.28 * @return GenderCache */ public function getGenderCache() { diff --git a/includes/ProxyLookup.php b/includes/ProxyLookup.php new file mode 100644 index 000..3a3243a --- /dev/null +++ b/includes/ProxyLookup.php @@ -0,0 +1,85 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +use IPSet\IPSet; + +/** + * @since 1.28 + */ +class ProxyLookup { + + /** +* @var string[] +*/ + private $proxyServers; + + /** +* @var string[] +*/ + private $proxyServersComplex; + + /** +* @var IPSet|null +*/ + private $proxyIPSet; + + /** +* @param string[] $proxyServers Simple list of IPs +* @param string[] $proxyServersComplex Complex list of IPs/ranges +*/ + public function __construct( $proxyServers, $proxyServersComplex ) { + $this->proxyServers =
[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Only pull in damaging scores when damaging model is enabled
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/312165 Change subject: Only pull in damaging scores when damaging model is enabled .. Only pull in damaging scores when damaging model is enabled And some other cleanup Change-Id: I75ab039ec62d9ac0125ee021c13898e87427c87f --- M includes/Hooks.php 1 file changed, 53 insertions(+), 46 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/65/312165/1 diff --git a/includes/Hooks.php b/includes/Hooks.php index 72cf720..65744b3 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -128,32 +128,40 @@ if ( !self::oresEnabled( $wgUser ) ) { return true; } - - $threshold = self::getDamagingThreshold( $wgUser ); $dbr = \wfGetDB( DB_REPLICA ); + $filtering = false; - $tables['ores_damaging_mdl'] = 'ores_model'; - $tables['ores_damaging_cls'] = 'ores_classification'; + if ( self::isModelEnabled( 'damaging' ) ) { + $threshold = self::getDamagingThreshold( $wgUser ); - $fields['ores_damaging_score'] = 'ores_damaging_cls.oresc_probability'; - // Add user-based threshold - $fields['ores_damaging_threshold'] = $dbr->addQuotes( $threshold ); + $tables['ores_damaging_mdl'] = 'ores_model'; + $tables['ores_damaging_cls'] = 'ores_classification'; - $join_conds['ores_damaging_mdl'] = [ 'LEFT JOIN', [ - 'ores_damaging_mdl.oresm_is_current' => 1, - 'ores_damaging_mdl.oresm_name' => 'damaging' - ] ]; - $join_conds['ores_damaging_cls'] = [ 'LEFT JOIN', [ - 'ores_damaging_cls.oresc_model = ores_damaging_mdl.oresm_id', - 'rc_this_oldid = ores_damaging_cls.oresc_rev', - 'ores_damaging_cls.oresc_class' => 1 - ] ]; + $fields['ores_damaging_score'] = 'ores_damaging_cls.oresc_probability'; + // Add user-based threshold + $fields['ores_damaging_threshold'] = $dbr->addQuotes( $threshold ); + + $join_conds['ores_damaging_mdl'] = [ 'LEFT JOIN', [ + 'ores_damaging_mdl.oresm_is_current' => 1, + 'ores_damaging_mdl.oresm_name' => 'damaging' + ] ]; + $join_conds['ores_damaging_cls'] = [ 'LEFT JOIN', [ + 'ores_damaging_cls.oresc_model = ores_damaging_mdl.oresm_id', + 'rc_this_oldid = ores_damaging_cls.oresc_rev', + 'ores_damaging_cls.oresc_class' => 1 + ] ]; - if ( self::isModelEnabled( 'damaging' ) && $opts->getValue( 'hidenondamaging' ) ) { - // Filter out non-damaging edits. - $conds[] = 'ores_damaging_cls.oresc_probability > ' - . $dbr->addQuotes( $threshold ); + if ( $opts->getValue( 'hidenondamaging' ) ) { + // Filter out non-damaging edits. + $conds[] = 'ores_damaging_cls.oresc_probability > ' . + $dbr->addQuotes( $threshold ); + $filtering = true; + } + } + + + if ( $filtering ) { $conds['rc_patrolled'] = 0; $query_options[] = 'STRAIGHT_JOIN'; } @@ -245,32 +253,36 @@ if ( !self::oresEnabled( $pager->getUser() ) ) { return true; } - - $threshold = self::getDamagingThreshold( $pager->getUser() ); $dbr = \wfGetDB( DB_REPLICA ); - $query['tables']['ores_damaging_mdl'] = 'ores_model'; - $query['tables']['ores_damaging_cls'] = 'ores_classification'; + if ( self::isModelEnabled( 'damaging' ) ) { + $threshold = self::getDamagingThreshold( $pager->getUser() ); - $query['fields']['ores_damaging_score'] = 'ores_damaging_cls.oresc_probability'; - // Add user-based threshold - $query['fields']['ores_damaging_threshold'] = $dbr->addQuotes( $threshold ); + $query['tables']['ores_damaging_mdl'] = 'ores_model'; + $query['tables']['ores_damaging_cls'] = 'ores_classification'; - $query['join_conds']['ores_damaging_mdl'] = [ 'LEFT JOIN', [ - 'ores_damaging_mdl.oresm_is_current' => 1, -
[MediaWiki-commits] [Gerrit] mediawiki...CheckUser[master]: Use the ProxyLookup service if possible
jenkins-bot has submitted this change and it was merged. Change subject: Use the ProxyLookup service if possible .. Use the ProxyLookup service if possible Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 --- M CheckUser.hooks.php 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php index 9c812d4..4797c99 100755 --- a/CheckUser.hooks.php +++ b/CheckUser.hooks.php @@ -1,4 +1,7 @@ getProxyLookup(); + } else { + // This is kind of sketch, but is good enough for back-compat + $proxyLookup = new IP(); + } + $client = null; // best guess of the client IP $isSquidOnly = false; // all proxy servers where site Squid/Varnish servers? # Step through XFF list and find the last address in the list which is a @@ -308,7 +318,7 @@ if ( $curIP === null ) { break; // not a valid IP address } - $curIsSquid = IP::isConfiguredProxy( $curIP ); + $curIsSquid = $proxyLookup->isConfiguredProxy( $curIP ); if ( $client === null ) { $client = $curIP; $isSquidOnly = $curIsSquid; -- To view, visit https://gerrit.wikimedia.org/r/312161 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CheckUser Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move SamplingStatsdClient into stats/ subdirectory
jenkins-bot has submitted this change and it was merged. Change subject: Move SamplingStatsdClient into stats/ subdirectory .. Move SamplingStatsdClient into stats/ subdirectory Change-Id: Ib871aa5cd674d58da3d19bfbb5660539afc863b3 --- M autoload.php R includes/libs/stats/SamplingStatsdClient.php 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 0c16e76..f2e1ed5 100644 --- a/autoload.php +++ b/autoload.php @@ -1224,7 +1224,7 @@ 'SQLiteField' => __DIR__ . '/includes/libs/rdbms/field/SQLiteField.php', 'SVGMetadataExtractor' => __DIR__ . '/includes/media/SVGMetadataExtractor.php', 'SVGReader' => __DIR__ . '/includes/media/SVGMetadataExtractor.php', - 'SamplingStatsdClient' => __DIR__ . '/includes/libs/SamplingStatsdClient.php', + 'SamplingStatsdClient' => __DIR__ . '/includes/libs/stats/SamplingStatsdClient.php', 'Sanitizer' => __DIR__ . '/includes/Sanitizer.php', 'SavepointPostgres' => __DIR__ . '/includes/libs/rdbms/database/utils/SavepointPostgres.php', 'ScopedCallback' => __DIR__ . '/includes/libs/ScopedCallback.php', diff --git a/includes/libs/SamplingStatsdClient.php b/includes/libs/stats/SamplingStatsdClient.php similarity index 100% rename from includes/libs/SamplingStatsdClient.php rename to includes/libs/stats/SamplingStatsdClient.php -- To view, visit https://gerrit.wikimedia.org/r/311931 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib871aa5cd674d58da3d19bfbb5660539afc863b3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: refreshLinks: Use vslow group for DB_REPLICA connections
jenkins-bot has submitted this change and it was merged. Change subject: refreshLinks: Use vslow group for DB_REPLICA connections .. refreshLinks: Use vslow group for DB_REPLICA connections Change-Id: If2f3bba7f0b518f26f0672150c94b999ac79f325 --- M maintenance/refreshLinks.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 106be1f..e7a4d06 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -90,7 +90,7 @@ $end = null, $redirectsOnly = false, $oldRedirectsOnly = false ) { $reportingInterval = 100; - $dbr = $this->getDB( DB_REPLICA ); + $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); if ( $start === null ) { $start = 1; @@ -282,7 +282,7 @@ ) { wfWaitForSlaves(); $this->output( "Deleting illegal entries from the links tables...\n" ); - $dbr = $this->getDB( DB_REPLICA ); + $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); do { // Find the start of the next chunk. This is based only // on existent page_ids. @@ -324,7 +324,7 @@ */ private function dfnCheckInterval( $start = null, $end = null, $batchSize = 100 ) { $dbw = $this->getDB( DB_MASTER ); - $dbr = $this->getDB( DB_REPLICA ); + $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); $linksTables = [ // table name => page_id field 'pagelinks' => 'pl_from', -- To view, visit https://gerrit.wikimedia.org/r/311072 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2f3bba7f0b518f26f0672150c94b999ac79f325 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than...
jenkins-bot has submitted this change and it was merged. Change subject: ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP .. ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP Bug: T143279 Depends-On: Ic93d733cb9e1b1d7301f8975c68ab7ded778845a Depends-On: I24c2819ec2adcab468f961c5c46b31c331324567 (for CA wikis) Depends-On: I372e7bdff35400287b3d961da979d6f094d13bd9 (for CA wikis) Change-Id: I14a1e5c9956d1b425eaacdf358db384df3be8115 --- M modules/ve-mw/dm/models/ve.dm.MWMediaResourceProvider.js 1 file changed, 8 insertions(+), 22 deletions(-) Approvals: Jforrester: Looks good to me, but someone else must approve Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/dm/models/ve.dm.MWMediaResourceProvider.js b/modules/ve-mw/dm/models/ve.dm.MWMediaResourceProvider.js index 8d24a32..7f37105 100644 --- a/modules/ve-mw/dm/models/ve.dm.MWMediaResourceProvider.js +++ b/modules/ve-mw/dm/models/ve.dm.MWMediaResourceProvider.js @@ -27,25 +27,13 @@ this.isLocal = config.local !== undefined; if ( this.isLocal ) { - this.setAjaxSettings( { - url: mw.util.wikiScript( 'api' ), - // If the url is local use json - dataType: 'json' - } ); + this.setAPIurl( mw.util.wikiScript( 'api' ) ); } else { - this.setAjaxSettings( { - // If 'apiurl' is set, use that. Otherwise, build the url - // from scriptDirUrl and /api.php suffix - url: this.getAPIurl() || ( this.scriptDirUrl + '/api.php' ), - // If the url is not the same origin use jsonp - dataType: 'jsonp', - // JSON-P requests are not cached by default and get a &_=random trail. - // While setting cache=true will still bypass cache in most case due to the - // callback parameter, at least drop the &_=random trail which triggers - // an API warning (invalid parameter). - cache: true - } ); + // If 'apiurl' is set, use that. Otherwise, build the url + // from scriptDirUrl and /api.php suffix + this.setAPIurl( this.getAPIurl() || ( this.scriptDirUrl + '/api.php' ) ); } + this.siteInfoPromise = null; this.thumbSizes = []; this.imageSizes = []; @@ -180,17 +168,15 @@ * the fetched data. */ ve.dm.MWMediaResourceProvider.prototype.fetchAPIresults = function ( howMany ) { - var xhr, - ajaxOptions = {}, + var xhr, api, provider = this; if ( !this.isValid() ) { return $.Deferred().reject().promise( { abort: $.noop } ); } - ajaxOptions = this.getAjaxSettings(); - - xhr = new mw.Api().get( $.extend( {}, this.getStaticParams(), this.getUserParams(), this.getContinueData( howMany ) ), ajaxOptions ); + api = this.isLocal ? new mw.Api() : new mw.ForeignApi( this.getAPIurl(), { anonymous: true } ); + xhr = api.get( $.extend( {}, this.getStaticParams(), this.getUserParams(), this.getContinueData( howMany ) ) ); return xhr .then( function ( data ) { var page, newObj, raw, -- To view, visit https://gerrit.wikimedia.org/r/309767 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I14a1e5c9956d1b425eaacdf358db384df3be8115 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Bartosz DziewońskiGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Esanders Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CheckUser[master]: Use the ProxyLookup service if possible
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312161 Change subject: Use the ProxyLookup service if possible .. Use the ProxyLookup service if possible Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 --- M CheckUser.hooks.php 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser refs/changes/61/312161/1 diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php index 9c812d4..b85610d 100755 --- a/CheckUser.hooks.php +++ b/CheckUser.hooks.php @@ -1,4 +1,7 @@ getProxyLookup(), 'isConfiguredProxy' ]; + } else { + $isConfigured = [ IP::class, 'isConfiguredProxy' ]; + } + $client = null; // best guess of the client IP $isSquidOnly = false; // all proxy servers where site Squid/Varnish servers? # Step through XFF list and find the last address in the list which is a @@ -308,7 +317,7 @@ if ( $curIP === null ) { break; // not a valid IP address } - $curIsSquid = IP::isConfiguredProxy( $curIP ); + $curIsSquid = call_user_func( $isConfigured, $curIP ); if ( $client === null ) { $client = $curIP; $isSquidOnly = $curIsSquid; -- To view, visit https://gerrit.wikimedia.org/r/312161 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CheckUser Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move IP::isConfigured/TrustedProxy() to ProxyLookup service
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312162 Change subject: Move IP::isConfigured/TrustedProxy() to ProxyLookup service .. Move IP::isConfigured/TrustedProxy() to ProxyLookup service This creates a new ProxyLookup service to house the IP::isConfiguredProxy() and IP::isTrustedProxy() functions. The main purpose of this refactoring is to make the IP class entirely independent from MediaWiki, so it can be split into a separate library. Change-Id: I60434a5f3d99880352bc0f72349c33b7d029ae09 --- M RELEASE-NOTES-1.28 M autoload.php M includes/Block.php M includes/MediaWikiServices.php A includes/ProxyLookup.php M includes/ServiceWiring.php M includes/WebRequest.php M includes/utils/IP.php M tests/phpunit/includes/WebRequestTest.php 9 files changed, 119 insertions(+), 54 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/62/312162/1 diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index fd6c613..a24f97a 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -202,6 +202,9 @@ Instead of --keep-uploads, use the same option to parserTests.php, but you must specify a directory with --upload-dir. * The 'jquery.arrowSteps' ResourceLoader module is now deprecated. +* IP::isConfiguredProxy() and IP::isTrustedProxy() were removed. Callers should + migrate to using the same functions on a ProxyLookup instance, obtainable from + MediaWikiServices. == Compatibility == diff --git a/autoload.php b/autoload.php index f5c334b..aa0f561 100644 --- a/autoload.php +++ b/autoload.php @@ -1100,6 +1100,7 @@ 'ProtectedPagesPager' => __DIR__ . '/includes/specials/SpecialProtectedpages.php', 'ProtectedTitlesPager' => __DIR__ . '/includes/specials/pagers/ProtectedTitlesPager.php', 'ProtectionForm' => __DIR__ . '/includes/ProtectionForm.php', + 'ProxyLookup' => __DIR__ . '/includes/ProxyLookup.php', 'PruneFileCache' => __DIR__ . '/maintenance/pruneFileCache.php', 'PublishStashedFileJob' => __DIR__ . '/includes/jobqueue/jobs/PublishStashedFileJob.php', 'PurgeAction' => __DIR__ . '/includes/actions/PurgeAction.php', diff --git a/includes/Block.php b/includes/Block.php index 19ba0a2..098d51c 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -19,6 +19,9 @@ * * @file */ + +use MediaWiki\MediaWikiServices; + class Block { /** @var string */ public $mReason; @@ -1120,6 +1123,7 @@ } $conds = []; + $proxyLookup = MediaWikiServices::getInstance()->getProxyLookup(); foreach ( array_unique( $ipChain ) as $ipaddr ) { # Discard invalid IP addresses. Since XFF can be spoofed and we do not # necessarily trust the header given to us, make sure that we are only @@ -1130,7 +1134,7 @@ continue; } # Don't check trusted IPs (includes local squids which will be in every request) - if ( IP::isTrustedProxy( $ipaddr ) ) { + if ( $proxyLookup->isTrustedProxy( $ipaddr ) ) { continue; } # Check both the original IP (to check against single blocks), as well as build diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index f621867..b16044e 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -19,6 +19,7 @@ use MediaWiki\Services\NoSuchServiceException; use MWException; use ObjectCache; +use ProxyLookup; use SearchEngine; use SearchEngineConfig; use SearchEngineFactory; @@ -531,6 +532,14 @@ /** * @since 1.28 +* @return ProxyLookup +*/ + public function getProxyLookup() { + return $this->getService( 'ProxyLookup' ); + } + + /** +* @since 1.28 * @return GenderCache */ public function getGenderCache() { diff --git a/includes/ProxyLookup.php b/includes/ProxyLookup.php new file mode 100644 index 000..3a3243a --- /dev/null +++ b/includes/ProxyLookup.php @@ -0,0 +1,85 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +use IPSet\IPSet; + +/** + * @since 1.28 + */ +class ProxyLookup { + + /** +* @var string[] +*/ + private $proxyServers; + + /** +* @var string[] +*/ + private $proxyServersComplex; + + /** +* @var IPSet|null +*/ + private $proxyIPSet; + + /** +* @param string[] $proxyServers Simple list of IPs +* @param string[] $proxyServersComplex Complex list of IPs/ranges +*/ + public function __construct( $proxyServers, $proxyServersComplex ) { + $this->proxyServers = $proxyServers; +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Enable Throttler to relax limits for users in some groups
Cenarium has uploaded a new change for review. https://gerrit.wikimedia.org/r/312017 Change subject: Enable Throttler to relax limits for users in some groups .. Enable Throttler to relax limits for users in some groups This adds a config variable $wgThrottleGroupMultipliers that allows to relax limits for users in some groups by multiplying the limits by some specified number. If the multiplier is zero, the throttle is bypassed. This allows to make some usergroups imune to the account creation limit without having to possess noratelimit. Bug: T146287 Change-Id: Ifb8425aa753731cb2dd441c8092ce39b9028b563 --- M includes/DefaultSettings.php M includes/auth/ThrottlePreAuthenticationProvider.php M includes/auth/Throttler.php M tests/phpunit/includes/auth/ThrottlerTest.php 4 files changed, 87 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/17/312017/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f0e9e83..6caab69 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5600,6 +5600,23 @@ $wgRateLimitsExcludedIPs = []; /** + * Array of strings mapped to arrays of strings mapped to nonnegative integers + * + * @par Example: + * You could have a group of account creators with 10 times the normal limit. + * @code + * $wgThrottleGroupMultipliers = [ + * 'createaccount' => [ + * 'accountcreator' => 10 + * ] + * ] + * @endcode + */ +$wgThrottleGroupMultipliers = [ + 'createaccount' => [], +]; + +/** * Log IP addresses in the recentchanges table; can be accessed only by * extensions (e.g. CheckUser) or a DB admin * Used for retroactive autoblocks diff --git a/includes/auth/ThrottlePreAuthenticationProvider.php b/includes/auth/ThrottlePreAuthenticationProvider.php index e2123ef..35a759d 100644 --- a/includes/auth/ThrottlePreAuthenticationProvider.php +++ b/includes/auth/ThrottlePreAuthenticationProvider.php @@ -76,10 +76,12 @@ ]; if ( !empty( $this->throttleSettings['accountCreationThrottle'] ) ) { + $allMultipliers = $this->config->get( 'ThrottleGroupMultipliers' ); $this->accountCreationThrottle = new Throttler( $this->throttleSettings['accountCreationThrottle'], [ 'type' => 'acctcreate', 'cache' => $this->cache, + 'multipliers' => $allMultipliers['createaccount'] ] ); } @@ -105,6 +107,7 @@ return \StatusValue::newGood(); } + $this->accountCreationThrottle->setGroups( $creator->getGroups() ); $result = $this->accountCreationThrottle->increase( null, $ip, __METHOD__ ); if ( $result ) { return \StatusValue::newFatal( 'acct_creation_throttle_hit', $result['count'] ); diff --git a/includes/auth/Throttler.php b/includes/auth/Throttler.php index f47c606..4d32a4a 100644 --- a/includes/auth/Throttler.php +++ b/includes/auth/Throttler.php @@ -49,6 +49,10 @@ protected $logger; /** @var int|float */ protected $warningLimit; + /** @var array */ + protected $groupMultipliers; + /** @var array|null */ + protected $groups = null; /** * @param array $conditions An array of arrays describing throttling conditions. @@ -61,7 +65,7 @@ */ public function __construct( array $conditions = null, array $params = [] ) { $invalidParams = array_diff_key( $params, - array_fill_keys( [ 'type', 'cache', 'warningLimit' ], true ) ); + array_fill_keys( [ 'type', 'cache', 'warningLimit', 'multipliers' ], true ) ); if ( $invalidParams ) { throw new \InvalidArgumentException( 'unrecognized parameters: ' . implode( ', ', array_keys( $invalidParams ) ) ); @@ -84,6 +88,7 @@ } $this->type = $params['type']; + $this->groupMultipliers = isset( $params['multipliers'] ) ? $params['multipliers'] : []; $this->conditions = static::normalizeThrottleConditions( $conditions ); $this->cache = $params['cache']; $this->warningLimit = $params['warningLimit']; @@ -93,6 +98,42 @@ public function setLogger( LoggerInterface $logger ) { $this->logger = $logger; + } + + /** +* Provide user groups of user being throttled +* +* @param array $groups +* @since 1.28 +*/ + public function setGroups( array $groups ) { +
[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[master]: Correct unicode literals
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/312160 Change subject: Correct unicode literals .. Correct unicode literals Bug: T144952 Change-Id: Idf25a9ff66d706aacab684876a3d585262402168 --- M includes/BannerRenderer.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/60/312160/1 diff --git a/includes/BannerRenderer.php b/includes/BannerRenderer.php index 0919aae..7593a86 100644 --- a/includes/BannerRenderer.php +++ b/includes/BannerRenderer.php @@ -133,8 +133,9 @@ $bannerKey = $this->banner->getDbKey(); $bannerHtml = $this->context->msg( $bannerKey )->inLanguage( $parentLang )->text(); + // FIXME: Find a way to use Language::getMessageFor, including fallback languages. if ( $bannerHtml === "<{$bannerKey}>" - || $bannerHtml === "\u29fc{$bannerKey}\u29fd" + || $bannerHtml === '⧼' . htmlspecialchars( $bannerKey ) . '⧽' ) { // Translation subsystem failure throw new RuntimeException( -- To view, visit https://gerrit.wikimedia.org/r/312160 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf25a9ff66d706aacab684876a3d585262402168 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Don't re-implement EditPage::getCopyrightWarning()
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312159 Change subject: Don't re-implement EditPage::getCopyrightWarning() .. Don't re-implement EditPage::getCopyrightWarning() Bug: T144364 Change-Id: I72d6ac9e41211384c8dc777cf42c5fed49358471 --- M VisualEditorDataModule.php 1 file changed, 10 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/59/312159/1 diff --git a/VisualEditorDataModule.php b/VisualEditorDataModule.php index 8eac30b..7fa83a5 100644 --- a/VisualEditorDataModule.php +++ b/VisualEditorDataModule.php @@ -19,7 +19,7 @@ public function getScript( ResourceLoaderContext $context ) { $msgInfo = $this->getMessageInfo( $context ); - $parsedMessages = []; + $parsedMessages = $msgInfo['parsed']; $textMessages = []; foreach ( $msgInfo['parse'] as $msgKey => $msgObj ) { $parsedMessages[ $msgKey ] = $msgObj->parse(); @@ -49,24 +49,13 @@ 'visualeditor-wikitext-warning' => $context->msg( 'visualeditor-wikitext-warning' ), ]; - // Copyright warning (based on EditPage::getCopyrightWarning) - $rightsText = $this->config->get( 'RightsText' ); - if ( $rightsText ) { - $copywarnMsgArgs = [ 'copyrightwarning', - '[[' . $context->msg( 'copyrightpage' )->inContentLanguage()->text() . ']]', - $rightsText ]; - } else { - $copywarnMsgArgs = [ 'copyrightwarning2', - '[[' . $context->msg( 'copyrightpage' )->inContentLanguage()->text() . ']]' ]; - } - // EditPage supports customisation based on title, we can't support that - $title = Title::newFromText( 'Dwimmerlaik' ); - Hooks::run( 'EditPageCopyrightWarning', [ $title, &$copywarnMsgArgs ] ); - // Normalise to 'copyrightwarning' so we have a consistent key in the front-end - $parseMsgs[ 'copyrightwarning' ] = call_user_func_array( - [ $context, 'msg' ], - $copywarnMsgArgs - ); + // Copyright warning (already parsed) + $parsedMsgs = [ + 'copyrightwarning' => EditPage::getCopyrightWarning( + // Use a dummy title + Title::newFromText( 'Dwimmerlaik' ), 'parse' + ), + ]; // Messages to be exported as text $textMsgs = [ @@ -76,6 +65,8 @@ return [ 'parse' => $parseMsgs, + // Already parsed + 'parsed' => $parsedMsgs, 'text' => $textMsgs, ]; } -- To view, visit https://gerrit.wikimedia.org/r/312159 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72d6ac9e41211384c8dc777cf42c5fed49358471 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Migrate callers to new MWFileProps::getPropsFromPath() method
jenkins-bot has submitted this change and it was merged. Change subject: Migrate callers to new MWFileProps::getPropsFromPath() method .. Migrate callers to new MWFileProps::getPropsFromPath() method * FSFile should not be responsible for handling this much logic. * Make more MediaHandler classes aware of the fact that an object other than File might be passed in. Use the FSFile instead of a useless empty stdClass object. * Also added more fields to FSFile::placeholderProps to make it more complete. Change-Id: I9fe764b2a7261af507c6555e6a57273cf7d00d36 --- M autoload.php M includes/MimeMagic.php M includes/filebackend/FSFile.php M includes/filerepo/FileRepo.php M includes/filerepo/RepoGroup.php M includes/filerepo/file/LocalFile.php M includes/media/BMP.php M includes/media/DjVu.php M includes/media/ExifBitmap.php M includes/media/MediaHandler.php M includes/media/PNG.php M includes/media/SVG.php M includes/media/Tiff.php M includes/media/WebP.php M includes/media/XCF.php M includes/upload/UploadBase.php M includes/upload/UploadStash.php A includes/utils/MWFileProps.php M maintenance/importImages.php M tests/common/TestsAutoLoader.php M tests/parser/ParserTestRunner.php M tests/phpunit/MediaWikiTestCase.php M tests/phpunit/includes/media/MediaWikiMediaTestCase.php A tests/phpunit/mocks/filerepo/MockLocalRepo.php 24 files changed, 203 insertions(+), 48 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 0c16e76..f5c334b 100644 --- a/autoload.php +++ b/autoload.php @@ -773,6 +773,7 @@ 'MWException' => __DIR__ . '/includes/exception/MWException.php', 'MWExceptionHandler' => __DIR__ . '/includes/exception/MWExceptionHandler.php', 'MWExceptionRenderer' => __DIR__ . '/includes/exception/MWExceptionRenderer.php', + 'MWFileProps' => __DIR__ . '/includes/utils/MWFileProps.php', 'MWGrants' => __DIR__ . '/includes/utils/MWGrants.php', 'MWHttpRequest' => __DIR__ . '/includes/HttpFunctions.php', 'MWMemcached' => __DIR__ . '/includes/compat/MemcachedClientCompat.php', diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index a432d44..5551865 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -1046,6 +1046,7 @@ } } + $type = null; // Check for entry for full MIME type if ( $mime ) { $type = $this->findMediaType( $mime ); diff --git a/includes/filebackend/FSFile.php b/includes/filebackend/FSFile.php index 221fe9f..e7e2608 100644 --- a/includes/filebackend/FSFile.php +++ b/includes/filebackend/FSFile.php @@ -112,37 +112,30 @@ $info['fileExists'] = $this->exists(); if ( $info['fileExists'] ) { + $info['size'] = $this->getSize(); // bytes + $info['sha1'] = $this->getSha1Base36(); + // @TODO: replace the code below with bare FileInfo use so this can go in /libs $magic = MimeMagic::singleton(); - - # get the file extension - if ( $ext === true ) { - $ext = self::extensionFromPath( $this->path ); - } # MIME type according to file contents $info['file-mime'] = $magic->guessMimeType( $this->path, false ); - # logical MIME type + # Logical MIME type + $ext = ( $ext === true ) ? FileBackend::extensionFromPath( $this->path ) : $ext; $info['mime'] = $magic->improveTypeFromExtension( $info['file-mime'], $ext ); list( $info['major_mime'], $info['minor_mime'] ) = File::splitMime( $info['mime'] ); $info['media_type'] = $magic->getMediaType( $this->path, $info['mime'] ); - # Get size in bytes - $info['size'] = $this->getSize(); - # Height, width and metadata $handler = MediaHandler::getHandler( $info['mime'] ); if ( $handler ) { - $tempImage = (object)[]; // XXX (hack for File object) - /** @noinspection PhpParamsInspection */ - $info['metadata'] = $handler->getMetadata( $tempImage, $this->path ); - /** @noinspection PhpParamsInspection */ - $gis = $handler->getImageSize( $tempImage, $this->path, $info['metadata'] ); + $info['metadata'] = $handler->getMetadata( $this, $this->path ); + /** @noinspection PhpMethodParametersCountMismatchInspection */ +
[MediaWiki-commits] [Gerrit] integration/config[master]: Whitelist Sam Wilson
jenkins-bot has submitted this change and it was merged. Change subject: Whitelist Sam Wilson .. Whitelist Sam Wilson Add personal email address of User:Samwilson / User:SWilson_(WMF) Change-Id: I6533dc09bf7a46277590029e5e4772e0b2822715 --- M zuul/layout.yaml 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 975e7b3..315b9db 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -175,6 +175,7 @@ | vogel@hallowelt\.biz | russblau@imapmail\.org | s7eph4n@gmail\.org +| sam@samwilson\.id\.au | santhosh\.thottingal@gmail\.com | saper@saper\.info | se4598@gmx\.de @@ -310,6 +311,7 @@ - ^niharikakohli29@gmail\.com$ - ^niklas\.laxstrom@gmail\.com$ - ^roan\.kattouw@gmail\.com$ + - ^sam@samwilson\.id\.au$ - ^santhosh\.thottingal@gmail\.com$ - ^shahyar@gmail\.com$ - ^siebrand@kitano\.nl$ -- To view, visit https://gerrit.wikimedia.org/r/312158 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6533dc09bf7a46277590029e5e4772e0b2822715 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Hashar Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Paladox Gerrit-Reviewer: Samwilson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: Whitelist Sam Wilson
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312158 Change subject: Whitelist Sam Wilson .. Whitelist Sam Wilson Add personal email address of User:Samwilson / User:SWilson_(WMF) Change-Id: I6533dc09bf7a46277590029e5e4772e0b2822715 --- M zuul/layout.yaml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/58/312158/1 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 975e7b3..315b9db 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -175,6 +175,7 @@ | vogel@hallowelt\.biz | russblau@imapmail\.org | s7eph4n@gmail\.org +| sam@samwilson\.id\.au | santhosh\.thottingal@gmail\.com | saper@saper\.info | se4598@gmx\.de @@ -310,6 +311,7 @@ - ^niharikakohli29@gmail\.com$ - ^niklas\.laxstrom@gmail\.com$ - ^roan\.kattouw@gmail\.com$ + - ^sam@samwilson\.id\.au$ - ^santhosh\.thottingal@gmail\.com$ - ^shahyar@gmail\.com$ - ^siebrand@kitano\.nl$ -- To view, visit https://gerrit.wikimedia.org/r/312158 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6533dc09bf7a46277590029e5e4772e0b2822715 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Samwilson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Only store the full country code if it is on our valid list.
jenkins-bot has submitted this change and it was merged. Change subject: Only store the full country code if it is on our valid list. .. Only store the full country code if it is on our valid list. If the country code is not on the list then prefer the 2 digit code. This means 'en' is better than 'en_NO (Norwegian English). Separately we will look to remove the invalid options we already have in our DB. If neither are valid store the full thing to make it easier to find them Bug: T96410 Change-Id: Ie7e8a958c2496a738ce738dd827b7ed04b2d9fbd --- M sites/all/modules/wmf_civicrm/wmf_civicrm.module 1 file changed, 30 insertions(+), 1 deletion(-) Approvals: Eileen: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index 376d3e8..654f568 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -1089,7 +1089,19 @@ } } if (!empty($contact['preferred_language'])) { -wmf_civicrm_ensure_language_exists($contact['preferred_language']); +if (!wmf_civicrm_check_language_exists($contact['preferred_language'])) { + $parts = explode('_', $contact['preferred_language']); + if (wmf_civicrm_check_language_exists($parts[0])) { +// in other words en_NO will be converted to en +// rather than Norwegian English. +$contact['preferred_language'] = $parts[0]; + } + else { +// otherwise let's create it rather than fail. +// seems like the easiest way not to lose visibility, data or the plot. +wmf_civicrm_ensure_language_exists($contact['preferred_language']); + } +} } // Copy some fields, if they exist @@ -1258,6 +1270,23 @@ } /** + * Check if the language string exists. + * + * @param string $languageAbbreviation + * + * @return bool + */ +function wmf_civicrm_check_language_exists($languageAbbreviation) { + static $languages; + if (empty($languages)) { +$available_options = civicrm_api3('Contact', 'getoptions', array( + 'field' => 'preferred_language', +)); +$languages = $available_options['values']; + } + return !empty($languages[$languageAbbreviation]); +} +/** * Ensure the required option value exists. * * @param string $option_value -- To view, visit https://gerrit.wikimedia.org/r/312156 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7e8a958c2496a738ce738dd827b7ed04b2d9fbd Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: EileenGerrit-Reviewer: Eileen Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: CiviCRM submodule update
Eileen has submitted this change and it was merged. Change subject: CiviCRM submodule update .. CiviCRM submodule update c291b67ed20677 Fix url for batch merge link Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a --- M civicrm 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Eileen: Looks good to me, approved jenkins-bot: Verified diff --git a/civicrm b/civicrm index 5abef3b..c291b67 16 --- a/civicrm +++ b/civicrm @@ -1 +1 @@ -Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac +Subproject commit c291b67ed20677edc1be3f9a0a70c0b127600c82 -- To view, visit https://gerrit.wikimedia.org/r/312157 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: EileenGerrit-Reviewer: Eileen Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Only store the full country code if it is on our valid list.
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312156 Change subject: Only store the full country code if it is on our valid list. .. Only store the full country code if it is on our valid list. If the country code is not on the list then prefer the 2 digit code. This means 'en' is better than 'en_NO (Norwegian English). Separately we will look to remove the invalid options we already have in our DB. If neither are valid store the full thing to make it easier to find them Bug: T96410 Change-Id: Ie7e8a958c2496a738ce738dd827b7ed04b2d9fbd --- M sites/all/modules/wmf_civicrm/wmf_civicrm.module 1 file changed, 30 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/56/312156/1 diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index 376d3e8..654f568 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -1089,7 +1089,19 @@ } } if (!empty($contact['preferred_language'])) { -wmf_civicrm_ensure_language_exists($contact['preferred_language']); +if (!wmf_civicrm_check_language_exists($contact['preferred_language'])) { + $parts = explode('_', $contact['preferred_language']); + if (wmf_civicrm_check_language_exists($parts[0])) { +// in other words en_NO will be converted to en +// rather than Norwegian English. +$contact['preferred_language'] = $parts[0]; + } + else { +// otherwise let's create it rather than fail. +// seems like the easiest way not to lose visibility, data or the plot. +wmf_civicrm_ensure_language_exists($contact['preferred_language']); + } +} } // Copy some fields, if they exist @@ -1258,6 +1270,23 @@ } /** + * Check if the language string exists. + * + * @param string $languageAbbreviation + * + * @return bool + */ +function wmf_civicrm_check_language_exists($languageAbbreviation) { + static $languages; + if (empty($languages)) { +$available_options = civicrm_api3('Contact', 'getoptions', array( + 'field' => 'preferred_language', +)); +$languages = $available_options['values']; + } + return !empty($languages[$languageAbbreviation]); +} +/** * Ensure the required option value exists. * * @param string $option_value -- To view, visit https://gerrit.wikimedia.org/r/312156 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7e8a958c2496a738ce738dd827b7ed04b2d9fbd Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: CiviCRM submodule update
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312157 Change subject: CiviCRM submodule update .. CiviCRM submodule update c291b67ed20677 Fix url for batch merge link Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a --- M civicrm 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/57/312157/1 diff --git a/civicrm b/civicrm index 5abef3b..c291b67 16 --- a/civicrm +++ b/civicrm @@ -1 +1 @@ -Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac +Subproject commit c291b67ed20677edc1be3f9a0a70c0b127600c82 -- To view, visit https://gerrit.wikimedia.org/r/312157 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add Index to contact.preferred_language
jenkins-bot has submitted this change and it was merged. Change subject: Add Index to contact.preferred_language .. Add Index to contact.preferred_language CRM-19350 Bug: T96410 Change-Id: If686ad6e20c2906221bc0b8c989ee2d913ad11e2 --- M sites/all/modules/wmf_civicrm/wmf_civicrm.install 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Eileen: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 78b227f..26a8724 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -2217,3 +2217,13 @@ SET e.is_primary = 1 "); } + +/** + * T128221 add index to civicrm_contribution.total_amount. + * + * Bug: T96410 + */ +function wmf_civicrm_update_7255() { + civicrm_initialize(); + CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contact' => array('preferred_language'))); +} -- To view, visit https://gerrit.wikimedia.org/r/312155 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If686ad6e20c2906221bc0b8c989ee2d913ad11e2 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Revise update to primaries not set.
jenkins-bot has submitted this change and it was merged. Change subject: Revise update to primaries not set. .. Revise update to primaries not set. This worked on staging but it must be missing some triggers as it failed on a circularity on prod. The temporary table should get past that After running this on staging I compared the total number of non-primary emails on staging with live. MariaDB [dev_civicrm]> SELECT count(*) FROM civicrm_email WHERE is_primary = 0; +--+ | count(*) | +--+ | 103604 | +--+ 1 row in set (0.41 sec) MariaDB [dev_civicrm]> SELECT count(*) FROM civicrm.civicrm_email WHERE is_primary = 0; +--+ | count(*) | +--+ |83426 | Around 20,000 difference - more than just the update but the DBs were not in like state to start with and I was really worried about something much larger happening (like updating all of them to be primary) The update would be around 10 k Bug: T143062 Change-Id: I73ecc0da3b89ea45db3cd4a1f6841ad850369d36 --- M sites/all/modules/wmf_civicrm/wmf_civicrm.install 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Eileen: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 9aeb973..78b227f 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -2202,14 +2202,18 @@ function wmf_civicrm_update_7250() { civicrm_initialize(); CRM_Core_DAO::executeQuery(" -UPDATE civicrm_email SET is_primary = 1 -WHERE id IN (SELECT id FROM +CREATE TEMPORARY TABLE civicrm_email_updates + SELECT id FROM ( SELECT contact_id, sum(is_primary) as c, e.id FROM civicrm_email e INNER JOIN civicrm_contact c ON c.id = contact_id AND is_deleted = 0 GROUP BY contact_id HAVING c = 0 ) as i -) + "); + + CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_email_updates ADD INDEX index_id(id)"); + CRM_Core_DAO::executeQuery("UPDATE civicrm_email e INNER JOIN civicrm_email_updates u ON e.id = u.id +SET e.is_primary = 1 "); } -- To view, visit https://gerrit.wikimedia.org/r/312154 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73ecc0da3b89ea45db3cd4a1f6841ad850369d36 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Revise update to primaries not set.
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312154 Change subject: Revise update to primaries not set. .. Revise update to primaries not set. This worked on staging but it must be missing some triggers as it failed on a circularity on prod. The temporary table should get past that After running this on staging I compared the total number of non-primary emails on staging with live. MariaDB [dev_civicrm]> SELECT count(*) FROM civicrm_email WHERE is_primary = 0; +--+ | count(*) | +--+ | 103604 | +--+ 1 row in set (0.41 sec) MariaDB [dev_civicrm]> SELECT count(*) FROM civicrm.civicrm_email WHERE is_primary = 0; +--+ | count(*) | +--+ |83426 | Around 20,000 difference - more than just the update but the DBs were not in like state to start with and I was really worried about something much larger happening (like updating all of them to be primary) The update would be around 10 k Bug: T143062 Change-Id: I73ecc0da3b89ea45db3cd4a1f6841ad850369d36 --- M sites/all/modules/wmf_civicrm/wmf_civicrm.install 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/54/312154/1 diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 9aeb973..78b227f 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -2202,14 +2202,18 @@ function wmf_civicrm_update_7250() { civicrm_initialize(); CRM_Core_DAO::executeQuery(" -UPDATE civicrm_email SET is_primary = 1 -WHERE id IN (SELECT id FROM +CREATE TEMPORARY TABLE civicrm_email_updates + SELECT id FROM ( SELECT contact_id, sum(is_primary) as c, e.id FROM civicrm_email e INNER JOIN civicrm_contact c ON c.id = contact_id AND is_deleted = 0 GROUP BY contact_id HAVING c = 0 ) as i -) + "); + + CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_email_updates ADD INDEX index_id(id)"); + CRM_Core_DAO::executeQuery("UPDATE civicrm_email e INNER JOIN civicrm_email_updates u ON e.id = u.id +SET e.is_primary = 1 "); } -- To view, visit https://gerrit.wikimedia.org/r/312154 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73ecc0da3b89ea45db3cd4a1f6841ad850369d36 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add Index to contact.preferred_language
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312155 Change subject: Add Index to contact.preferred_language .. Add Index to contact.preferred_language CRM-19350 Bug: T96410 Change-Id: If686ad6e20c2906221bc0b8c989ee2d913ad11e2 --- M sites/all/modules/wmf_civicrm/wmf_civicrm.install 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/55/312155/1 diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 78b227f..26a8724 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -2217,3 +2217,13 @@ SET e.is_primary = 1 "); } + +/** + * T128221 add index to civicrm_contribution.total_amount. + * + * Bug: T96410 + */ +function wmf_civicrm_update_7255() { + civicrm_initialize(); + CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contact' => array('preferred_language'))); +} -- To view, visit https://gerrit.wikimedia.org/r/312155 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If686ad6e20c2906221bc0b8c989ee2d913ad11e2 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: CiviCRM submodule update
Eileen has submitted this change and it was merged. Change subject: CiviCRM submodule update .. CiviCRM submodule update c291b67ed20677 Fix url for batch merge link Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a --- M civicrm 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Eileen: Looks good to me, approved jenkins-bot: Verified diff --git a/civicrm b/civicrm index 5abef3b..c291b67 16 --- a/civicrm +++ b/civicrm @@ -1 +1 @@ -Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac +Subproject commit c291b67ed20677edc1be3f9a0a70c0b127600c82 -- To view, visit https://gerrit.wikimedia.org/r/312153 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: create shell account for Volker E.
Dzahn has submitted this change and it was merged. Change subject: admin: create shell account for Volker E. .. admin: create shell account for Volker E. Volker E has requested access to people.wm.org, no sudo involved, waiting period has passed a while ago. UID matches existing labs user, which has a @wikimedia.org email address. Bug:T143465 Change-Id: I5cb8f1a3dae93f58198597b241f34802d38e3964 --- M modules/admin/data/data.yaml 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml index 64a8a9c..e727bbe 100644 --- a/modules/admin/data/data.yaml +++ b/modules/admin/data/data.yaml @@ -2151,3 +2151,11 @@ ssh_keys: - ssh-rsa B3NzaC1yc2EDAQABAAABAQDBSqKkOktF20xShNmJgeOpkhDYXFgcCvNPKbexn67on5M0hPNTKZjptFPCeoQh/i3suAvPDFakDt0pEcCZzzzcwArM21LJ2EFWeqwl6il20L45aD52y8zYYPrTtAi2YaqP77kbSl7/jVW0AFzM6m/G9e5550oeZKDbHGkANpi9uAqn7EjTI88i0txnTEGG6Bwu4G4H/08BsKbkW2C3sB2/h4V1GEHMhxlDEfhlEsVqfaYgrxmXJsTyAjsgawx+fIuqDJsrIFCWlu7IIfur+g0o+DVIDE5kCzZLUeD7FfwP0ym03f7fXF/yjg0sQzXKPF1eXLKXod+7Mn+KOnxLnj+d swal...@wikimedia.org uid: 15557 + volkere: +ensure: present +gid: 500 +name: volkere +realname: Volker Eckl +ssh_keys: + - ssh-rsa B3NzaC1yc2EDAQABAAACAQDKpQEVtQw8XJCKvG7oNL9d+dveFqRpHCzduUvdzi6MK7zgtY9xUKF7ZcQObgP5fCpgLonDUu2b61WRzYgiPoBkhhnTKqRkCx6sT6KfsHaSE2iZefW5N7qEyRqpWCoXfmGnXJdP3r4cCgxBqdAJ/aoFNcvzpLUrcgw7wfI+gJ6VV897fwkH9SEnjVUxn/AZDAxsK6xa2gDmCUjG+Biwl6LsRCXtop87jtJ6SdgKmDkmGNh8t2y6YJxE0vjYuzNH2E2bEaYOgFRS/GULbNh+U+UqrN3sE4RTHUzAOqXh3iYShpNnwgm9nj41j3Q4h1S51muPEywRz60nU16JfaAvvvA3vyrS2L1P3zB7F+MbvhVVhdprmMvQf7hXbqSNhcxBWwvYfGGA67jy6hDL8WCd8+ql5F7tGw66FxStDjs2GYCiLp0zaDeBkl5Fx9GKjTXD8kCtA7Y8JDLuW1L/7ROX58C8tO6SyHjHHQO4hpSUavieUHt+2CFLYWvGtBZFStdL+esQmOC6qjX1KdwSQxlRXN9D436VxGusVdo3gkbaVvPFVx25gefWrKQ0/a17iU3eDL02sVkNa91Xs3AfeNNTqOv111UfoZjsatva7ZhBujeD131Ky7wolm1IVYtwfF4ifEpgLwjHtSzgfmdMLJSv4IweGYebc71JILMOHZCQGJ3/iw== volke...@wikimedia.org +uid: 12186 -- To view, visit https://gerrit.wikimedia.org/r/307667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cb8f1a3dae93f58198597b241f34802d38e3964 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Dzahn Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Fix to prevent duplicate Home addresses resulting in no prim...
jenkins-bot has submitted this change and it was merged. Change subject: Fix to prevent duplicate Home addresses resulting in no primary on merge. .. Fix to prevent duplicate Home addresses resulting in no primary on merge. Bug: T145873 Change-Id: Icee9aab5179e6e42cbedd2fa615072053834962b --- M sites/all/modules/wmf_civicrm/wmf_civicrm.module 1 file changed, 42 insertions(+), 1 deletion(-) Approvals: Eileen: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index 21d09d9..376d3e8 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -2281,8 +2281,9 @@ // In the test this should always be true - but keep the check in case // something changes that we need to detect. if ($lastDonorID != $mainId) { -$higherPriorityLocationBlocks = $migrationInfo['other_details']['location_blocks']; +$higherPriorityLocationBlocks = _wmf_civicrm_clean_duplicate_location_from_merge_blocks($migrationInfo['other_details']['location_blocks']); $lowerPriorityLocationBlocks = $migrationInfo['main_details']['location_blocks']; + foreach ($higherPriorityLocationBlocks as $blockType => $blocks) { foreach ($blocks as $block) { if (empty($lowerPriorityLocationBlocks[$blockType])) { @@ -2317,6 +2318,46 @@ } /** + * Clean up any instances of 2 identical home addresses before processing. + * + * It's not valid to have 2 addresses of the same location type in CiviCRM. + * However, they seem to still be coming in so for now ensure they don't cause + * issues when deduping, with the is_primary flag being lost. + * + * T145873 + * + * @param array $blocks + * An array of locations associated with a contact. These are keyed by entity + * (email, address, phone) and under that an array of db entries. + * + * @return array + * Blocks, possibly with some removed. + */ +function _wmf_civicrm_clean_duplicate_location_from_merge_blocks($blocks) { + foreach ($blocks as $entity => $locationBlocks) { +$locations = array(); +$primaryID = NULL; +foreach ($locationBlocks as $index => $locationBlock) { + $locations[$locationBlock['location_type_id']][$index] = $locationBlock['id']; + if ($locationBlock['is_primary']) { +$primaryID = $locationBlock['id']; + } +} +foreach ($locations as $locationsOfType) { + if (count($locationsOfType) > 1) { +// We have a duplicate. +foreach ($locationsOfType as $index => $locationID) { + if ($locationID <> $primaryID) { +unset($blocks[$entity][$index]); + } +} + } +} + } + return $blocks; +} + +/** * Add the calculated fields to the migration info when merging. * * The contributions have already been merged so we can query the DB for this info. We -- To view, visit https://gerrit.wikimedia.org/r/312152 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icee9aab5179e6e42cbedd2fa615072053834962b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: CiviCRM submodule update
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312153 Change subject: CiviCRM submodule update .. CiviCRM submodule update c291b67ed20677 Fix url for batch merge link Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a --- M civicrm 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/53/312153/1 diff --git a/civicrm b/civicrm index 5abef3b..c291b67 16 --- a/civicrm +++ b/civicrm @@ -1 +1 @@ -Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac +Subproject commit c291b67ed20677edc1be3f9a0a70c0b127600c82 -- To view, visit https://gerrit.wikimedia.org/r/312153 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49d2a21e184b93f39cb5139b11d52c2371bf628a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Fix to prevent duplicate Home addresses resulting in no prim...
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/312152 Change subject: Fix to prevent duplicate Home addresses resulting in no primary on merge. .. Fix to prevent duplicate Home addresses resulting in no primary on merge. Bug: T145873 Change-Id: Icee9aab5179e6e42cbedd2fa615072053834962b --- M sites/all/modules/wmf_civicrm/wmf_civicrm.module 1 file changed, 42 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/52/312152/1 diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index 21d09d9..376d3e8 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -2281,8 +2281,9 @@ // In the test this should always be true - but keep the check in case // something changes that we need to detect. if ($lastDonorID != $mainId) { -$higherPriorityLocationBlocks = $migrationInfo['other_details']['location_blocks']; +$higherPriorityLocationBlocks = _wmf_civicrm_clean_duplicate_location_from_merge_blocks($migrationInfo['other_details']['location_blocks']); $lowerPriorityLocationBlocks = $migrationInfo['main_details']['location_blocks']; + foreach ($higherPriorityLocationBlocks as $blockType => $blocks) { foreach ($blocks as $block) { if (empty($lowerPriorityLocationBlocks[$blockType])) { @@ -2317,6 +2318,46 @@ } /** + * Clean up any instances of 2 identical home addresses before processing. + * + * It's not valid to have 2 addresses of the same location type in CiviCRM. + * However, they seem to still be coming in so for now ensure they don't cause + * issues when deduping, with the is_primary flag being lost. + * + * T145873 + * + * @param array $blocks + * An array of locations associated with a contact. These are keyed by entity + * (email, address, phone) and under that an array of db entries. + * + * @return array + * Blocks, possibly with some removed. + */ +function _wmf_civicrm_clean_duplicate_location_from_merge_blocks($blocks) { + foreach ($blocks as $entity => $locationBlocks) { +$locations = array(); +$primaryID = NULL; +foreach ($locationBlocks as $index => $locationBlock) { + $locations[$locationBlock['location_type_id']][$index] = $locationBlock['id']; + if ($locationBlock['is_primary']) { +$primaryID = $locationBlock['id']; + } +} +foreach ($locations as $locationsOfType) { + if (count($locationsOfType) > 1) { +// We have a duplicate. +foreach ($locationsOfType as $index => $locationID) { + if ($locationID <> $primaryID) { +unset($blocks[$entity][$index]); + } +} + } +} + } + return $blocks; +} + +/** * Add the calculated fields to the migration info when merging. * * The contributions have already been merged so we can query the DB for this info. We -- To view, visit https://gerrit.wikimedia.org/r/312152 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icee9aab5179e6e42cbedd2fa615072053834962b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Improve completion, add more completion words
Smalyshev has uploaded a new change for review. https://gerrit.wikimedia.org/r/312151 Change subject: Improve completion, add more completion words .. Improve completion, add more completion words Bug: T144052 Change-Id: I95ef1f3531f2abe11a204696e457805907757725 --- M wikibase/queryService/RdfNamespaces.js M wikibase/queryService/ui/editor/hint/Rdf.js M wikibase/queryService/ui/editor/hint/Sparql.js 3 files changed, 53 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui refs/changes/51/312151/1 diff --git a/wikibase/queryService/RdfNamespaces.js b/wikibase/queryService/RdfNamespaces.js index b10bdc1..29a5c39 100644 --- a/wikibase/queryService/RdfNamespaces.js +++ b/wikibase/queryService/RdfNamespaces.js @@ -16,10 +16,13 @@ wdv: 'http://www.wikidata.org/value/', ps: 'http://www.wikidata.org/prop/statement/', psv: 'http://www.wikidata.org/prop/statement/value/', + psn: 'http://www.wikidata.org/prop/statement/value-normalized/', pq: 'http://www.wikidata.org/prop/qualifier/', pqv: 'http://www.wikidata.org/prop/qualifier/value/', + pqn: 'http://www.wikidata.org/prop/qualifier/value-normalized/', pr: 'http://www.wikidata.org/prop/reference/', prv: 'http://www.wikidata.org/prop/reference/value/', + prn: 'http://www.wikidata.org/prop/reference/value-normalized/', wdno: 'http://www.wikidata.org/prop/novalue/', wdata: 'http://www.wikidata.org/wiki/Special:EntityData/' }, @@ -48,10 +51,13 @@ 'http://www.wikidata.org/prop/novalue/': 'property', 'http://www.wikidata.org/prop/statement/': 'property', 'http://www.wikidata.org/prop/statement/value/': 'property', + 'http://www.wikidata.org/prop/statement/value-normalized/': 'property', 'http://www.wikidata.org/prop/qualifier/': 'property', 'http://www.wikidata.org/prop/qualifier/value/': 'property', + 'http://www.wikidata.org/prop/qualifier/value-normalized/': 'property', 'http://www.wikidata.org/prop/reference/': 'property', 'http://www.wikidata.org/prop/reference/value/': 'property', + 'http://www.wikidata.org/prop/reference/value-normalized/': 'property', 'http://www.wikidata.org/wiki/Special:EntityData/': 'item', 'http://www.wikidata.org/entity/': 'item' }; diff --git a/wikibase/queryService/ui/editor/hint/Rdf.js b/wikibase/queryService/ui/editor/hint/Rdf.js index f3b9c08..68b1896 100755 --- a/wikibase/queryService/ui/editor/hint/Rdf.js +++ b/wikibase/queryService/ui/editor/hint/Rdf.js @@ -57,11 +57,15 @@ return deferred.reject().promise(); } - prefix = this._getPrefixFromWord( currentWord.word.trim() ); + prefix = this._getPrefixFromWord( currentWord.word.trim() ) term = this._getTermFromWord( currentWord.word.trim() ); entityPrefixes = this._extractPrefixes( editorContent ); if ( !entityPrefixes[prefix] ) { // unknown prefix + if (this._rdfNamespaces.ALL_PREFIXES[prefix] ) { + // Sparql.js may deal with those prefixes + return deferred.reject().promise(); + } list = [ { text: term, displayText: 'Unknown prefix \'' + prefix + ':\'' diff --git a/wikibase/queryService/ui/editor/hint/Sparql.js b/wikibase/queryService/ui/editor/hint/Sparql.js index 3724694..2e6bc4d 100755 --- a/wikibase/queryService/ui/editor/hint/Sparql.js +++ b/wikibase/queryService/ui/editor/hint/Sparql.js @@ -22,15 +22,50 @@ ]; var SPARQL_PREDICATES = [ + // wikibase: + // property predicates 'wikibase:rank', 'wikibase:badge', 'wikibase:propertyType', 'wikibase:directClaim', 'wikibase:claim', 'wikibase:statementProperty', 'wikibase:statementValue', 'wikibase:qualifier', 'wikibase:qualifierValue', 'wikibase:referenceValue', - 'wikibase:Reference', 'wikibase:TimeValue', 'wikibase:QuantityValue', - 'wikibase:GlobecoordinateValue', 'wikibase:Dump', 'wikibase:PreferredRank', - 'wikibase:NormalRank', 'wikibase:DeprecatedRank', 'wikibase:BestRank', - 'wikibase:WikibaseItem', 'wikibase:CommonsMedia', 'wikibase:Globecoordinate', +
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix to prevent duplicate Home addresses resulting in no prim...
Eileen has submitted this change and it was merged. Change subject: Fix to prevent duplicate Home addresses resulting in no primary on merge. .. Fix to prevent duplicate Home addresses resulting in no primary on merge. Bug: T145873 Change-Id: Icee9aab5179e6e42cbedd2fa615072053834962b --- M sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php M sites/all/modules/wmf_civicrm/wmf_civicrm.module 2 files changed, 125 insertions(+), 15 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php index 349c8d9..1f71ccd 100644 --- a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php +++ b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php @@ -426,7 +426,7 @@ */ public function getMergeLocations($locationParams1, $locationParams2, $locationParams3, $entity, $additionalExpected = array()) { $data = array( - 1 => array( + 'matching_primary' => array( 'matching_primary' => array( 'merged' => 1, 'skipped' => 0, @@ -461,7 +461,7 @@ )), ), ), - 2 => array( + 'matching_primary_reverse' => array( 'matching_primary_reverse' => array( 'merged' => 1, 'skipped' => 0, @@ -496,7 +496,7 @@ )), ), ), - 3 => array( + 'only_one_has_address' => array( 'only_one_has_address' => array( 'merged' => 1, 'skipped' => 0, @@ -528,7 +528,7 @@ )), ), ), - 4 => array( + 'only_one_has_address_reverse' => array( 'only_one_has_address_reverse' => array( 'merged' => 1, 'skipped' => 0, @@ -558,7 +558,7 @@ )), ), ), - 5 => array( + 'different_primaries_with_different_location_type' => array( 'different_primaries_with_different_location_type' => array( 'merged' => 1, 'skipped' => 0, @@ -589,7 +589,7 @@ )), ), ), - 6 => array( + 'different_primaries_with_different_location_type_reverse' => array( 'different_primaries_with_different_location_type_reverse' => array( 'merged' => 1, 'skipped' => 0, @@ -619,7 +619,7 @@ )), ), ), - 7 => array( + 'different_primaries_location_match_only_one_address' => array( 'different_primaries_location_match_only_one_address' => array( 'merged' => 1, 'skipped' => 0, @@ -654,7 +654,7 @@ )), ), ), - 8 => array( + 'different_primaries_location_match_only_one_address_reverse' => array( 'different_primaries_location_match_only_one_address_reverse' => array( 'merged' => 1, 'skipped' => 0, @@ -688,7 +688,7 @@ )), ), ), - 9 => array( + 'same_primaries_different_location' => array( 'same_primaries_different_location' => array( 'fix_required_for_reverse' => 1, 'comment' => 'core is not identifying this as an address conflict in reverse order' @@ -719,7 +719,7 @@ )), ), ), - 10 => array( + 'same_primaries_different_location_reverse' => array( 'same_primaries_different_location_reverse' => array( 'fix_required_for_reverse' => 1, 'comment' => 'core is not identifying this as an address conflict in reverse order' @@ -749,7 +749,7 @@ )), ), ), - 11 => array( + 'conflicting_home_address_major_gifts' => array( 'conflicting_home_address_major_gifts' => array( 'merged' => 0, 'skipped' => 1, @@ -775,7 +775,7 @@ )), ), ), - 12 => array( + 'conflicting_home_address_not_major_gifts' => array( 'conflicting_home_address_not_major_gifts' => array( 'fix_required_for_reverse' => 1, 'comment' => 'our code needs an update as both are being kept' @@ -805,7 +805,7 @@ )), ), ), - 13 => array( + 'conflicting_home_address_one_more_major_gifts' => array( 'conflicting_home_address_one_more_major_gifts' => array( 'merged' => 0, 'skipped' => 1, @@ -843,7 +843,7 @@ )), ), ), - 14 => array( + 'conflicting_home_address__one_more_not_major_gifts' => array( 'conflicting_home_address__one_more_not_major_gifts' => array( 'fix_required_for_reverse' => 1, 'comment' => 'our code needs an update as an extra 1 is being kept' @@ -885,6 +885,75 @@ )), ), ), + 'duplicate_home_address_on_one_contact' => array( +'duplicate_home_address_on_one_contact' => array( +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Dependency inject $wgTmpDirectory into FileBackend classes
jenkins-bot has submitted this change and it was merged. Change subject: Dependency inject $wgTmpDirectory into FileBackend classes .. Dependency inject $wgTmpDirectory into FileBackend classes Change-Id: I219daffa67ff672bf5bd38921f4b1ca058d96b0f --- M includes/filebackend/FSFileBackend.php M includes/filebackend/FileBackendGroup.php M includes/filebackend/MemoryFileBackend.php M includes/filebackend/SwiftFileBackend.php M includes/filerepo/FSRepo.php M includes/libs/filebackend/FileBackend.php 6 files changed, 13 insertions(+), 5 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index b0e3eee..45951ec 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -195,7 +195,7 @@ } if ( !empty( $params['async'] ) ) { // deferred - $tempFile = TempFSFile::factory( 'create_', 'tmp' ); + $tempFile = TempFSFile::factory( 'create_', 'tmp', $this->tmpDirectory ); if ( !$tempFile ) { $status->fatal( 'backend-fail-create', $params['dst'] ); @@ -653,7 +653,7 @@ } else { // Create a new temporary file with the same extension... $ext = FileBackend::extensionFromPath( $src ); - $tmpFile = TempFSFile::factory( 'localcopy_', $ext ); + $tmpFile = TempFSFile::factory( 'localcopy_', $ext, $this->tmpDirectory ); if ( !$tmpFile ) { $tmpFiles[$src] = null; } else { diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 0bae5ff..b560e94 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -168,6 +168,7 @@ $config['wanCache'] = ObjectCache::getMainWANInstance(); $config['mimeCallback'] = [ $this, 'guessMimeInternal' ]; $config['statusWrapper'] = [ 'Status', 'wrap' ]; + $config['tmpDirectory'] = wfTempDir(); $this->backends[$name]['instance'] = new $class( $config ); } @@ -222,7 +223,7 @@ if ( !$type && $fsPath ) { $type = $magic->guessMimeType( $fsPath, false ); } elseif ( !$type && strlen( $content ) ) { - $tmpFile = TempFSFile::factory( 'mime_' ); + $tmpFile = TempFSFile::factory( 'mime_', '', wfTempDir() ); file_put_contents( $tmpFile->getPath(), $content ); $type = $magic->guessMimeType( $tmpFile->getPath(), false ); } diff --git a/includes/filebackend/MemoryFileBackend.php b/includes/filebackend/MemoryFileBackend.php index 74a0068..44fe2cb 100644 --- a/includes/filebackend/MemoryFileBackend.php +++ b/includes/filebackend/MemoryFileBackend.php @@ -169,7 +169,7 @@ } else { // Create a new temporary file with the same extension... $ext = FileBackend::extensionFromPath( $src ); - $fsFile = TempFSFile::factory( 'localcopy_', $ext ); + $fsFile = TempFSFile::factory( 'localcopy_', $ext, $this->tmpDirectory ); if ( $fsFile ) { $bytes = file_put_contents( $fsFile->getPath(), $this->files[$src]['data'] ); if ( $bytes !== strlen( $this->files[$src]['data'] ) ) { diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index a0027e4..0a0e9f5 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -1127,7 +1127,7 @@ // Get source file extension $ext = FileBackend::extensionFromPath( $path ); // Create a new temporary file... - $tmpFile = TempFSFile::factory( 'localcopy_', $ext ); + $tmpFile = TempFSFile::factory( 'localcopy_', $ext, $this->tmpDirectory ); if ( $tmpFile ) { $handle = fopen( $tmpFile->getPath(), 'wb' ); if ( $handle ) { diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index b24354d..d06acf2 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -66,6 +66,7 @@
[MediaWiki-commits] [Gerrit] operations/puppet[production]: upload storage: transition cp1063+cp1064
BBlack has submitted this change and it was merged. Change subject: upload storage: transition cp1063+cp1064 .. upload storage: transition cp1063+cp1064 Change-Id: I2bbe7fe3479fe32bc0739a5042bede019f6a68a3 --- A hieradata/hosts/cp1063.yaml A hieradata/hosts/cp1064.yaml 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/hieradata/hosts/cp1063.yaml b/hieradata/hosts/cp1063.yaml new file mode 100644 index 000..c02abf9 --- /dev/null +++ b/hieradata/hosts/cp1063.yaml @@ -0,0 +1 @@ +upload_storage_experiment: true diff --git a/hieradata/hosts/cp1064.yaml b/hieradata/hosts/cp1064.yaml new file mode 100644 index 000..c02abf9 --- /dev/null +++ b/hieradata/hosts/cp1064.yaml @@ -0,0 +1 @@ +upload_storage_experiment: true -- To view, visit https://gerrit.wikimedia.org/r/311998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bbe7fe3479fe32bc0739a5042bede019f6a68a3 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack Gerrit-Reviewer: Ema Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update FundraisingEmailUnsubscribe to mirror to Redis
jenkins-bot has submitted this change and it was merged. Change subject: Update FundraisingEmailUnsubscribe to mirror to Redis .. Update FundraisingEmailUnsubscribe to mirror to Redis Bug: T145419 Change-Id: Id06488d08f489181f6ad104e12369252d6c5cb8f --- M extensions/FundraisingEmailUnsubscribe 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/FundraisingEmailUnsubscribe b/extensions/FundraisingEmailUnsubscribe index 5d41df0..2aa1f7b 16 --- a/extensions/FundraisingEmailUnsubscribe +++ b/extensions/FundraisingEmailUnsubscribe @@ -1 +1 @@ -Subproject commit 5d41df00247b442fd516c909cfeaf9074e6a4ad2 +Subproject commit 2aa1f7b48e86226043679f66040694cf7b34fe01 -- To view, visit https://gerrit.wikimedia.org/r/312150 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id06488d08f489181f6ad104e12369252d6c5cb8f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: AwightGerrit-Reviewer: Awight Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make MigrateFileRepoLayout use getErrors()
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312149 Change subject: Make MigrateFileRepoLayout use getErrors() .. Make MigrateFileRepoLayout use getErrors() Change-Id: I5281c4ded9eba42eccaf5a67e809a0175fa057ce --- M maintenance/migrateFileRepoLayout.php 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/312149/1 diff --git a/maintenance/migrateFileRepoLayout.php b/maintenance/migrateFileRepoLayout.php index bd73f8b..f771fff 100644 --- a/maintenance/migrateFileRepoLayout.php +++ b/maintenance/migrateFileRepoLayout.php @@ -104,7 +104,7 @@ $status = $be->prepare( [ 'dir' => dirname( $dpath ), 'bypassReadOnly' => 1 ] ); if ( !$status->isOK() ) { - $this->error( print_r( $status->getErrorsArray(), true ) ); + $this->error( print_r( $status->getErrors(), true ) ); } $batch[] = [ 'op' => 'copy', 'overwrite' => true, @@ -137,7 +137,7 @@ $status = $be->prepare( [ 'dir' => dirname( $dpath ), 'bypassReadOnly' => 1 ] ); if ( !$status->isOK() ) { - $this->error( print_r( $status->getErrorsArray(), true ) ); + $this->error( print_r( $status->getErrors(), true ) ); } $batch[] = [ 'op' => 'copy', 'overwrite' => true, 'src' => $spath, 'dst' => $dpath, 'img' => $ofile->getArchiveName() ]; @@ -195,7 +195,7 @@ $status = $be->prepare( [ 'dir' => dirname( $dpath ), 'bypassReadOnly' => 1 ] ); if ( !$status->isOK() ) { - $this->error( print_r( $status->getErrorsArray(), true ) ); + $this->error( print_r( $status->getErrors(), true ) ); } $batch[] = [ 'op' => 'copy', 'src' => $spath, 'dst' => $dpath, @@ -227,7 +227,7 @@ $status = $be->doOperations( $ops, [ 'bypassReadOnly' => 1 ] ); if ( !$status->isOK() ) { - $this->output( print_r( $status->getErrorsArray(), true ) ); + $this->output( print_r( $status->getErrors(), true ) ); } $this->output( "Batch done\n\n" ); -- To view, visit https://gerrit.wikimedia.org/r/312149 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5281c4ded9eba42eccaf5a67e809a0175fa057ce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update FundraisingEmailUnsubscribe to mirror to Redis
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/312150 Change subject: Update FundraisingEmailUnsubscribe to mirror to Redis .. Update FundraisingEmailUnsubscribe to mirror to Redis Bug: T145419 Change-Id: Id06488d08f489181f6ad104e12369252d6c5cb8f --- M extensions/FundraisingEmailUnsubscribe 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/50/312150/1 diff --git a/extensions/FundraisingEmailUnsubscribe b/extensions/FundraisingEmailUnsubscribe index 5d41df0..2aa1f7b 16 --- a/extensions/FundraisingEmailUnsubscribe +++ b/extensions/FundraisingEmailUnsubscribe @@ -1 +1 @@ -Subproject commit 5d41df00247b442fd516c909cfeaf9074e6a4ad2 +Subproject commit 2aa1f7b48e86226043679f66040694cf7b34fe01 -- To view, visit https://gerrit.wikimedia.org/r/312150 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id06488d08f489181f6ad104e12369252d6c5cb8f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: [deploy with crm code] Rely on CiviCRM address rather than c...
jenkins-bot has submitted this change and it was merged. Change subject: [deploy with crm code] Rely on CiviCRM address rather than contribution tracking language. .. [deploy with crm code] Rely on CiviCRM address rather than contribution tracking language. Bug: T96410 Change-Id: Icc03b7162209b877905a7f12718b67657dcce338 --- M silverpop_export/update_table.sql 1 file changed, 5 insertions(+), 20 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/silverpop_export/update_table.sql b/silverpop_export/update_table.sql index 963524d..9773cd4 100755 --- a/silverpop_export/update_table.sql +++ b/silverpop_export/update_table.sql @@ -19,7 +19,7 @@ contact_id int unsigned, first_name varchar(128), last_name varchar(128), - preferred_language varchar(5), + preferred_language varchar(12), email varchar(255), opted_out tinyint(1), @@ -63,7 +63,7 @@ (id, contact_id, email, first_name, last_name, preferred_language, opted_out) SELECT e.id, e.contact_id, e.email, c.first_name, c.last_name, -IF(SUBSTRING(c.preferred_language, 1, 1) = '_', 'en', SUBSTRING(c.preferred_language, 1, 2)), +REPLACE(c.preferred_language, '_', '-'), (c.is_opt_out OR c.do_not_email OR e.on_hold OR COALESCE(d.do_not_solicit, 0)) FROM civicrm.civicrm_email e LEFT JOIN civicrm.civicrm_contact c ON e.contact_id = c.id @@ -74,7 +74,7 @@ AND e.is_primary = 1; -- Find the latest donation for each email address. Ordering by --- recieve_date and total_amount descending should always insert +-- receive_date and total_amount descending should always insert -- the latest donation first, with the larger prevailing for an -- email with multiple simultaneous donations. All the rest for -- that email will be ignored due to the unique constraint. We @@ -103,21 +103,6 @@ ct.total_amount DESC ON DUPLICATE KEY UPDATE latest_currency = silverpop_export_latest.latest_currency; --- Populate data from contribution tracking, because that's fairly --- reliable. Do this before deduplication so we can attempt to make --- intelligent fallbacks in case of null data --- (11 minutes) -UPDATE -silverpop_export_staging ex, -civicrm.civicrm_contribution ct, -drupal.contribution_tracking dct - SET -ex.preferred_language = dct.language - WHERE -ex.contact_id = ct.contact_id AND -dct.contribution_id = ct.id AND -dct.language IS NOT NULL; - -- (15 minutes) UPDATE silverpop_export_staging ex, @@ -138,7 +123,7 @@ id INT PRIMARY KEY AUTO_INCREMENT, email varchar(255), maxid int, - preferred_language varchar(5), + preferred_language varchar(12), country varchar(2), opted_out tinyint(1), @@ -329,7 +314,7 @@ contact_id int unsigned, first_name varchar(128), last_name varchar(128), - preferred_language varchar(5), + preferred_language varchar(12), email varchar(255), -- Lifetime contribution statistics -- To view, visit https://gerrit.wikimedia.org/r/311491 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc03b7162209b877905a7f12718b67657dcce338 Gerrit-PatchSet: 6 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Springle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Drop unused "WikibaseChange" hook
jenkins-bot has submitted this change and it was merged. Change subject: Drop unused "WikibaseChange" hook .. Drop unused "WikibaseChange" hook There is a "WikibaseChangeNotification" hook identical to this one, but running on all 4 "notifyOnPage…" methods, not only 2. I did a GitHub search for "WikibaseChange" and could not find a user of this hook. Bug: T103665 Change-Id: Idec9581672d530c33e3dd9333865a892164b263e --- M repo/includes/Notifications/ChangeNotifier.php 1 file changed, 0 insertions(+), 5 deletions(-) Approvals: Smalyshev: Looks good to me, approved Daniel Kinzler: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/Notifications/ChangeNotifier.php b/repo/includes/Notifications/ChangeNotifier.php index 50ec107..65a1d0b 100644 --- a/repo/includes/Notifications/ChangeNotifier.php +++ b/repo/includes/Notifications/ChangeNotifier.php @@ -2,7 +2,6 @@ namespace Wikibase\Repo\Notifications; -use Hooks; use InvalidArgumentException; use Revision; use User; @@ -64,13 +63,11 @@ } $change = $this->changeFactory->newFromUpdate( EntityChange::REMOVE, $content->getEntity() ); - $change->setTimestamp( $timestamp ); $change->setMetadataFromUser( $user ); $this->transmitChange( $change ); - Hooks::run( 'WikibaseChange', array( $change ) ); return $change; } @@ -102,7 +99,6 @@ $this->transmitChange( $change ); - Hooks::run( 'WikibaseChange', array( $change ) ); return $change; } @@ -127,7 +123,6 @@ } $change = $this->changeFactory->newFromUpdate( EntityChange::ADD, null, $content->getEntity() ); - $change->setRevisionInfo( $revision ); // FIXME: RepoHooks::onRecentChangeSave currently adds to the change later! -- To view, visit https://gerrit.wikimedia.org/r/311928 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idec9581672d530c33e3dd9333865a892164b263e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE)Gerrit-Reviewer: Addshore Gerrit-Reviewer: Aude Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: move FeaturedImageCardView callback
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312144 Change subject: Hygiene: move FeaturedImageCardView callback .. Hygiene: move FeaturedImageCardView callback Encapsulate FeaturedImageCardView's callback as FeaturedImageCardView.Callback. Change-Id: Ideeed05abecb0de2b662a02d9d65de32aad10558 --- M app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 2 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/44/312144/1 diff --git a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java index e233f4d..567b87c 100644 --- a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java +++ b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java @@ -21,6 +21,12 @@ public class FeaturedImageCardView extends DefaultFeedCardView implements ItemTouchHelperSwipeAdapter.SwipeableView { +public interface Callback { +void onShareImage(@NonNull FeaturedImageCard card); +void onDownloadImage(@NonNull FeaturedImage image); +void onFeaturedImageSelected(@NonNull FeaturedImageCard card); +} + @BindView(R.id.view_featured_image_card_header) View headerView; @BindView(R.id.view_featured_image_card_footer) View footerView; @BindView(R.id.view_featured_image_card_image) FaceAndColorDetectImageView imageView; diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java index fbb2fdb..f29a75a 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java @@ -2,17 +2,13 @@ import android.support.annotation.NonNull; -import org.wikipedia.feed.image.FeaturedImage; -import org.wikipedia.feed.image.FeaturedImageCard; +import org.wikipedia.feed.image.FeaturedImageCardView; import org.wikipedia.feed.news.NewsItemCard; import org.wikipedia.views.ItemTouchHelperSwipeAdapter; public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback, -PageTitleListCardItemView.Callback, CardHeaderView.Callback { +PageTitleListCardItemView.Callback, CardHeaderView.Callback, FeaturedImageCardView.Callback { void onSearchRequested(); void onVoiceSearchRequested(); void onNewsItemSelected(@NonNull NewsItemCard card); -void onShareImage(@NonNull FeaturedImageCard card); -void onDownloadImage(@NonNull FeaturedImage image); -void onFeaturedImageSelected(@NonNull FeaturedImageCard card); } -- To view, visit https://gerrit.wikimedia.org/r/312144 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ideeed05abecb0de2b662a02d9d65de32aad10558 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: encapsulate FeedAdapter callback in class
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312142 Change subject: Hygiene: encapsulate FeedAdapter callback in class .. Hygiene: encapsulate FeedAdapter callback in class Move FeedAdapter specific callback into FeedAdapter.Callback. Change-Id: Id8c68b20b1b5693cc7a1c473a92d4fd31b07ca0e --- M app/src/main/java/org/wikipedia/feed/FeedFragment.java M app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 3 files changed, 9 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/42/312142/1 diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java b/app/src/main/java/org/wikipedia/feed/FeedFragment.java index dcd093c..f233f3e 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java +++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java @@ -53,7 +53,7 @@ private WikipediaApp app; private FeedCoordinator coordinator; private FeedFunnel funnel; -private FeedViewCallback feedCallback = new FeedCallback(); +private FeedAdapter.Callback feedCallback = new FeedCallback(); private FeedScrollListener feedScrollListener = new FeedScrollListener(); private OverflowCallback overflowCallback = new OverflowCallback(); private boolean searchIconVisible; @@ -194,7 +194,7 @@ return FragmentUtil.getCallback(this, Callback.class); } -private class FeedCallback implements FeedViewCallback { +private class FeedCallback implements FeedAdapter.Callback { @Override public void onRequestMore() { funnel.requestMore(coordinator.getAge()); diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java b/app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java index fa6c99d..3f84cfb 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java @@ -13,10 +13,14 @@ import org.wikipedia.views.DefaultViewHolder; public class FeedAdapter> extends DefaultRecyclerAdapter{ -@NonNull private FeedCoordinatorBase coordinator; -@Nullable private FeedViewCallback callback; +public interface Callback extends FeedViewCallback { +void onRequestMore(); +} -public FeedAdapter(@NonNull FeedCoordinatorBase coordinator, @Nullable FeedViewCallback callback) { +@NonNull private FeedCoordinatorBase coordinator; +@Nullable private Callback callback; + +public FeedAdapter(@NonNull FeedCoordinatorBase coordinator, @Nullable Callback callback) { super(coordinator.getCards()); this.coordinator = coordinator; this.callback = callback; diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java index e88e0ae..29c6fd7 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java @@ -10,7 +10,6 @@ public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback, PageTitleListCardItemView.Callback { -void onRequestMore(); void onSearchRequested(); void onVoiceSearchRequested(); boolean onRequestDismissCard(@NonNull Card card); -- To view, visit https://gerrit.wikimedia.org/r/312142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8c68b20b1b5693cc7a1c473a92d4fd31b07ca0e Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: name callback s/getters consistently
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312140 Change subject: Hygiene: name callback s/getters consistently .. Hygiene: name callback s/getters consistently Change-Id: Ic7043296b355ccef33dea73cd665fdfa357b5c2c --- M app/src/main/java/org/wikipedia/feed/FeedFragment.java M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java M app/src/main/java/org/wikipedia/feed/view/FeedView.java M app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java M app/src/main/java/org/wikipedia/views/AutoFitRecyclerView.java 5 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/40/312140/1 diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java b/app/src/main/java/org/wikipedia/feed/FeedFragment.java index 57da467..dcd093c 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java +++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java @@ -95,7 +95,7 @@ unbinder = ButterKnife.bind(this, view); feedView.setAdapter(new FeedAdapter<>(coordinator, feedCallback)); -feedView.callback(feedCallback); +feedView.setCallback(feedCallback); feedView.addOnScrollListener(feedScrollListener); swipeRefreshLayout.setColorSchemeResources(R.color.foundation_blue); @@ -134,7 +134,7 @@ coordinator.setFeedUpdateListener(null); swipeRefreshLayout.setOnRefreshListener(null); feedView.removeOnScrollListener(feedScrollListener); -feedView.callback((FeedViewCallback) null); +feedView.setCallback((FeedViewCallback) null); unbinder.unbind(); unbinder = null; super.onDestroyView(); diff --git a/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java b/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java index 9787b65..6ae01e5 100644 --- a/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java +++ b/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java @@ -53,7 +53,7 @@ final NewsItemCard card = item(i); holder.getView().setText(card.text()); holder.getView().setImage(card.image()); -holder.getView().callback(callback); +holder.getView().setCallback(callback); holder.getView().setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java b/app/src/main/java/org/wikipedia/feed/view/FeedView.java index a97716a..68a20c0 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java @@ -35,7 +35,7 @@ init(); } -public void callback(@Nullable ItemTouchHelperSwipeAdapter.Callback callback) { +public void setCallback(@Nullable ItemTouchHelperSwipeAdapter.Callback callback) { if (itemTouchHelper != null) { itemTouchHelper.attachToRecyclerView(new DummyView(getContext())); itemTouchHelper = null; @@ -65,7 +65,7 @@ R.dimen.view_list_card_margin_horizontal, R.dimen.view_list_card_margin_vertical)); addItemDecoration(new HeaderMarginItemDecoration(getContext(), R.dimen.view_list_first_card_margin_top)); -callback(new RecyclerViewColumnCallback()); +setCallback(new RecyclerViewColumnCallback()); } /* Workaround for https://code.google.com/p/android/issues/detail?id=205947. diff --git a/app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java b/app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java index ed412bb..893f6f3 100644 --- a/app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java +++ b/app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java @@ -25,12 +25,12 @@ ButterKnife.bind(this); } -public void callback(@Nullable FeedViewCallback callback) { +public void setCallback(@Nullable FeedViewCallback callback) { this.callback = callback; } @Nullable -public FeedViewCallback callback() { +public FeedViewCallback getCallback() { return callback; } diff --git a/app/src/main/java/org/wikipedia/views/AutoFitRecyclerView.java b/app/src/main/java/org/wikipedia/views/AutoFitRecyclerView.java index b900c85..a0b88c9 100644 --- a/app/src/main/java/org/wikipedia/views/AutoFitRecyclerView.java +++ b/app/src/main/java/org/wikipedia/views/AutoFitRecyclerView.java @@ -50,7 +50,7 @@ } } -public void callback(@Nullable Callback callback) { +public void setCallback(@Nullable Callback callback) { this.callback = callback == null ? new DefaultCallback() :
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: move FeedViewCallback to FeedAdapter
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312147 Change subject: Hygiene: move FeedViewCallback to FeedAdapter .. Hygiene: move FeedViewCallback to FeedAdapter Change-Id: Id9f302237469637405de51c4bd413cf311186bb0 --- M app/src/main/java/org/wikipedia/feed/FeedFragment.java M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java M app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java M app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java M app/src/main/java/org/wikipedia/feed/progress/ProgressCardView.java M app/src/main/java/org/wikipedia/feed/random/RandomCardView.java M app/src/main/java/org/wikipedia/feed/view/DefaultFeedCardView.java M app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java M app/src/main/java/org/wikipedia/feed/view/FeedCardView.java D app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java M app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java 12 files changed, 36 insertions(+), 40 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/47/312147/1 diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java b/app/src/main/java/org/wikipedia/feed/FeedFragment.java index f233f3e..cc8ba76 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java +++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java @@ -30,7 +30,6 @@ import org.wikipedia.feed.news.NewsItemCard; import org.wikipedia.feed.view.FeedAdapter; import org.wikipedia.feed.view.FeedView; -import org.wikipedia.feed.view.FeedViewCallback; import org.wikipedia.history.HistoryEntry; import org.wikipedia.login.LoginActivity; import org.wikipedia.settings.Prefs; @@ -134,7 +133,7 @@ coordinator.setFeedUpdateListener(null); swipeRefreshLayout.setOnRefreshListener(null); feedView.removeOnScrollListener(feedScrollListener); -feedView.setCallback((FeedViewCallback) null); +feedView.setCallback((FeedAdapter.Callback) null); unbinder.unbind(); unbinder = null; super.onDestroyView(); diff --git a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java index 7bb7fce..98319e5 100644 --- a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java +++ b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java @@ -9,7 +9,7 @@ import org.wikipedia.R; import org.wikipedia.feed.view.CardHeaderView; import org.wikipedia.feed.view.CardLargeHeaderView; -import org.wikipedia.feed.view.FeedViewCallback; +import org.wikipedia.feed.view.FeedAdapter; import org.wikipedia.feed.view.ListCardView; import org.wikipedia.feed.view.PageTitleListCardItemView; import org.wikipedia.feed.view.PageTitleRecyclerAdapter; @@ -66,9 +66,10 @@ } private static class RecyclerAdapter extends PageTitleRecyclerAdapter { -@Nullable private FeedViewCallback callback; +@Nullable private FeedAdapter.Callback callback; -RecyclerAdapter(@NonNull List items, @Nullable FeedViewCallback callback) { +RecyclerAdapter(@NonNull List items, +@Nullable FeedAdapter.Callback callback) { super(items); this.callback = callback; } diff --git a/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java b/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java index fb87390..1fe5bd1 100644 --- a/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java +++ b/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java @@ -7,7 +7,7 @@ import org.wikipedia.R; import org.wikipedia.WikipediaApp; -import org.wikipedia.feed.view.FeedViewCallback; +import org.wikipedia.feed.view.FeedAdapter; import org.wikipedia.feed.view.StaticCardView; import org.wikipedia.history.HistoryEntry; import org.wikipedia.page.PageTitle; @@ -29,16 +29,16 @@ setIcon(R.drawable.icon_feed_today); } -@Override public void setCallback(@Nullable FeedViewCallback callback) { +@Override public void setCallback(@Nullable FeedAdapter.Callback callback) { super.setCallback(callback); setOnClickListener(new CallbackAdapter(callback)); } private static class CallbackAdapter implements OnClickListener { @NonNull private WikipediaApp app = WikipediaApp.getInstance(); -@Nullable private final FeedViewCallback callback; +@Nullable private final FeedAdapter.Callback callback; -CallbackAdapter(@Nullable FeedViewCallback callback) { +CallbackAdapter(@Nullable FeedAdapter.Callback callback) { this.callback = callback;
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: encapsulate SearchCardView's callback
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312145 Change subject: Hygiene: encapsulate SearchCardView's callback .. Hygiene: encapsulate SearchCardView's callback Change-Id: Icf476bca12b3b8901acd781e2e1283770a8c93d8 --- M app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 2 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/45/312145/1 diff --git a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java index 82348f5..184e871 100644 --- a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java +++ b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java @@ -10,6 +10,11 @@ import butterknife.OnClick; public class SearchCardView extends DefaultFeedCardView { +public interface Callback { +void onSearchRequested(); +void onVoiceSearchRequested(); +} + public SearchCardView(Context context) { super(context); inflate(getContext(), R.layout.view_search_bar, this); diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java index f29a75a..d1323f3 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java @@ -4,11 +4,11 @@ import org.wikipedia.feed.image.FeaturedImageCardView; import org.wikipedia.feed.news.NewsItemCard; +import org.wikipedia.feed.searchbar.SearchCardView; import org.wikipedia.views.ItemTouchHelperSwipeAdapter; public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback, -PageTitleListCardItemView.Callback, CardHeaderView.Callback, FeaturedImageCardView.Callback { -void onSearchRequested(); -void onVoiceSearchRequested(); +PageTitleListCardItemView.Callback, CardHeaderView.Callback, FeaturedImageCardView.Callback, +SearchCardView.Callback { void onNewsItemSelected(@NonNull NewsItemCard card); } -- To view, visit https://gerrit.wikimedia.org/r/312145 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf476bca12b3b8901acd781e2e1283770a8c93d8 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: encapsulate NewsListCardView's callback
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312146 Change subject: Hygiene: encapsulate NewsListCardView's callback .. Hygiene: encapsulate NewsListCardView's callback Change-Id: I63539c2a7f2c351f8da0b1c0b46e1764fc224419 --- M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/46/312146/1 diff --git a/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java b/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java index 6ae01e5..17affef 100644 --- a/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java +++ b/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java @@ -18,6 +18,9 @@ public class NewsListCardView extends HorizontalScrollingListCardView implements ItemTouchHelperSwipeAdapter.SwipeableView { +public interface Callback { +void onNewsItemSelected(@NonNull NewsItemCard card); +} public NewsListCardView(@NonNull Context context) { super(context); diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java index d1323f3..323eb86 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java @@ -1,14 +1,11 @@ package org.wikipedia.feed.view; -import android.support.annotation.NonNull; - import org.wikipedia.feed.image.FeaturedImageCardView; -import org.wikipedia.feed.news.NewsItemCard; +import org.wikipedia.feed.news.NewsListCardView; import org.wikipedia.feed.searchbar.SearchCardView; import org.wikipedia.views.ItemTouchHelperSwipeAdapter; public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback, PageTitleListCardItemView.Callback, CardHeaderView.Callback, FeaturedImageCardView.Callback, -SearchCardView.Callback { -void onNewsItemSelected(@NonNull NewsItemCard card); +SearchCardView.Callback, NewsListCardView.Callback { } -- To view, visit https://gerrit.wikimedia.org/r/312146 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63539c2a7f2c351f8da0b1c0b46e1764fc224419 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: encapsulate CardHeaderView callback
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312143 Change subject: Hygiene: encapsulate CardHeaderView callback .. Hygiene: encapsulate CardHeaderView callback Move CardHeaderView's callback to within the class itself. This makes it obvious to clients what the true dependencies of the class' callback are because its precise and gives a clear CardHeaderView.Callback reference. Change-Id: Ifd20df3f32d46176b7b28987c263708b69b764eb --- M app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 2 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/43/312143/1 diff --git a/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java b/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java index 40c8a59..9d5b3e2 100644 --- a/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java +++ b/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java @@ -23,11 +23,15 @@ import butterknife.OnClick; public class CardHeaderView extends FrameLayout { +public interface Callback { +boolean onRequestDismissCard(@NonNull Card card); +} + @BindView(R.id.view_card_header_image) AppCompatImageView imageView; @BindView(R.id.view_card_header_title) TextView titleView; @BindView(R.id.view_card_header_subtitle) TextView subtitleView; @Nullable private Card card; -@Nullable private FeedViewCallback callback; +@Nullable private Callback callback; public CardHeaderView(Context context) { super(context); @@ -40,7 +44,7 @@ return this; } -@NonNull public CardHeaderView setCallback(@Nullable FeedViewCallback callback) { +@NonNull public CardHeaderView setCallback(@Nullable Callback callback) { this.callback = callback; return this; } diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java index 29c6fd7..fbb2fdb 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java @@ -4,15 +4,13 @@ import org.wikipedia.feed.image.FeaturedImage; import org.wikipedia.feed.image.FeaturedImageCard; -import org.wikipedia.feed.model.Card; import org.wikipedia.feed.news.NewsItemCard; import org.wikipedia.views.ItemTouchHelperSwipeAdapter; public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback, -PageTitleListCardItemView.Callback { +PageTitleListCardItemView.Callback, CardHeaderView.Callback { void onSearchRequested(); void onVoiceSearchRequested(); -boolean onRequestDismissCard(@NonNull Card card); void onNewsItemSelected(@NonNull NewsItemCard card); void onShareImage(@NonNull FeaturedImageCard card); void onDownloadImage(@NonNull FeaturedImage image); -- To view, visit https://gerrit.wikimedia.org/r/312143 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd20df3f32d46176b7b28987c263708b69b764eb Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: move PageTitleListCardItemCallback
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312141 Change subject: Hygiene: move PageTitleListCardItemCallback .. Hygiene: move PageTitleListCardItemCallback Move PageTitleListCardItemCallback into PageTitleListCardItemView.Callback since this is what the callback is attached to and the pattern we use for Fragments. Change-Id: Id56e2c3396f519bde077ffa08a24b1c0faccf235 --- D app/src/main/java/org/wikipedia/PageTitleListCardItemCallback.java M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java M app/src/main/java/org/wikipedia/feed/view/PageTitleListCardItemView.java M app/src/main/java/org/wikipedia/news/NewsFragment.java 4 files changed, 13 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/41/312141/1 diff --git a/app/src/main/java/org/wikipedia/PageTitleListCardItemCallback.java b/app/src/main/java/org/wikipedia/PageTitleListCardItemCallback.java deleted file mode 100644 index 09460fa..000 --- a/app/src/main/java/org/wikipedia/PageTitleListCardItemCallback.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.wikipedia; - -import android.support.annotation.NonNull; - -import org.wikipedia.history.HistoryEntry; - -public interface PageTitleListCardItemCallback { -void onSelectPage(@NonNull HistoryEntry entry); -void onAddPageToList(@NonNull HistoryEntry entry); -void onSharePage(@NonNull HistoryEntry entry); -} diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java index a42cd99..e88e0ae 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java @@ -2,15 +2,14 @@ import android.support.annotation.NonNull; -import org.wikipedia.PageTitleListCardItemCallback; -import org.wikipedia.feed.image.FeaturedImageCard; import org.wikipedia.feed.image.FeaturedImage; -import org.wikipedia.feed.news.NewsItemCard; +import org.wikipedia.feed.image.FeaturedImageCard; import org.wikipedia.feed.model.Card; +import org.wikipedia.feed.news.NewsItemCard; import org.wikipedia.views.ItemTouchHelperSwipeAdapter; public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback, -PageTitleListCardItemCallback { +PageTitleListCardItemView.Callback { void onRequestMore(); void onSearchRequested(); void onVoiceSearchRequested(); diff --git a/app/src/main/java/org/wikipedia/feed/view/PageTitleListCardItemView.java b/app/src/main/java/org/wikipedia/feed/view/PageTitleListCardItemView.java index 27a6ae9..ca7fc79 100644 --- a/app/src/main/java/org/wikipedia/feed/view/PageTitleListCardItemView.java +++ b/app/src/main/java/org/wikipedia/feed/view/PageTitleListCardItemView.java @@ -7,13 +7,18 @@ import android.view.MenuItem; import android.view.View; -import org.wikipedia.PageTitleListCardItemCallback; import org.wikipedia.R; import org.wikipedia.history.HistoryEntry; import org.wikipedia.views.ViewUtil; public class PageTitleListCardItemView extends ListCardItemView { -@Nullable private PageTitleListCardItemCallback callback; +public interface Callback { +void onSelectPage(@NonNull HistoryEntry entry); +void onAddPageToList(@NonNull HistoryEntry entry); +void onSharePage(@NonNull HistoryEntry entry); +} + +@Nullable private Callback callback; @Nullable private HistoryEntry entry; public PageTitleListCardItemView(Context context) { @@ -34,7 +39,7 @@ }); } -@NonNull public PageTitleListCardItemView setCallback(@Nullable PageTitleListCardItemCallback callback) { +@NonNull public PageTitleListCardItemView setCallback(@Nullable Callback callback) { this.callback = callback; return this; } diff --git a/app/src/main/java/org/wikipedia/news/NewsFragment.java b/app/src/main/java/org/wikipedia/news/NewsFragment.java index 60deb5e..41ce284 100644 --- a/app/src/main/java/org/wikipedia/news/NewsFragment.java +++ b/app/src/main/java/org/wikipedia/news/NewsFragment.java @@ -15,7 +15,6 @@ import android.view.ViewGroup; import android.widget.TextView; -import org.wikipedia.PageTitleListCardItemCallback; import org.wikipedia.R; import org.wikipedia.Site; import org.wikipedia.feed.news.NewsItem; @@ -115,7 +114,7 @@ protected static class RecyclerAdapter extends DefaultRecyclerAdapter{ @Nullable private Callback callback; -protected RecyclerAdapter(@NonNull List items, @NonNull Callback callback) { +RecyclerAdapter(@NonNull List items, @NonNull Callback callback) { super(items); this.callback = callback; } @@ -132,7 +131,7 @@ } } -private class Callback implements
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Null out feed card callbacks when Activity dies
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/312148 Change subject: Null out feed card callbacks when Activity dies .. Null out feed card callbacks when Activity dies Bug: T146086 Change-Id: I1c56cfff175ec9d8bfeab523bcc6c3cf6b5fff24 --- M app/src/main/java/org/wikipedia/feed/FeedFragment.java M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java M app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java M app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java M app/src/main/java/org/wikipedia/feed/random/RandomCardView.java M app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java 7 files changed, 42 insertions(+), 57 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/48/312148/1 diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java b/app/src/main/java/org/wikipedia/feed/FeedFragment.java index cc8ba76..bfedc71 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java +++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java @@ -49,10 +49,11 @@ @BindView(R.id.feed_swipe_refresh_layout) SwipeRefreshLayout swipeRefreshLayout; @BindView(R.id.fragment_feed_feed) FeedView feedView; private Unbinder unbinder; +private FeedAdapter feedAdapter; private WikipediaApp app; private FeedCoordinator coordinator; private FeedFunnel funnel; -private FeedAdapter.Callback feedCallback = new FeedCallback(); +private final FeedAdapter.Callback feedCallback = new FeedCallback(); private FeedScrollListener feedScrollListener = new FeedScrollListener(); private OverflowCallback overflowCallback = new OverflowCallback(); private boolean searchIconVisible; @@ -93,7 +94,8 @@ View view = inflater.inflate(R.layout.fragment_feed, container, false); unbinder = ButterKnife.bind(this, view); -feedView.setAdapter(new FeedAdapter<>(coordinator, feedCallback)); +feedAdapter = new FeedAdapter<>(coordinator, feedCallback); +feedView.setAdapter(feedAdapter); feedView.setCallback(feedCallback); feedView.addOnScrollListener(feedScrollListener); @@ -112,8 +114,8 @@ public void update(List cards) { if (isAdded()) { swipeRefreshLayout.setRefreshing(false); -if (feedView.getAdapter() != null) { -feedView.getAdapter().notifyDataSetChanged(); +if (feedView != null && feedAdapter != null) { +feedAdapter.notifyDataSetChanged(); } } } @@ -134,6 +136,8 @@ swipeRefreshLayout.setOnRefreshListener(null); feedView.removeOnScrollListener(feedScrollListener); feedView.setCallback((FeedAdapter.Callback) null); +feedView.setAdapter(null); +feedAdapter = null; unbinder.unbind(); unbinder = null; super.onDestroyView(); diff --git a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java index 98319e5..e73fde7 100644 --- a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java +++ b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java @@ -2,14 +2,12 @@ import android.content.Context; import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.support.annotation.PluralsRes; import android.view.View; import org.wikipedia.R; import org.wikipedia.feed.view.CardHeaderView; import org.wikipedia.feed.view.CardLargeHeaderView; -import org.wikipedia.feed.view.FeedAdapter; import org.wikipedia.feed.view.ListCardView; import org.wikipedia.feed.view.PageTitleListCardItemView; import org.wikipedia.feed.view.PageTitleRecyclerAdapter; @@ -29,7 +27,7 @@ @Override public void setCard(@NonNull BecauseYouReadCard card) { super.setCard(card); header(card); -set(new RecyclerAdapter(card.items(), getCallback())); +set(new RecyclerAdapter(card.items())); } private void header(@NonNull final BecauseYouReadCard card) { @@ -65,20 +63,16 @@ } } -private static class RecyclerAdapter extends PageTitleRecyclerAdapter { -@Nullable private FeedAdapter.Callback callback; - -RecyclerAdapter(@NonNull List items, -@Nullable FeedAdapter.Callback callback) { +private class RecyclerAdapter extends PageTitleRecyclerAdapter { +RecyclerAdapter(@NonNull List items) { super(items); -this.callback = callback; } @Override public void
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update English languages to only keep a small number of reco...
jenkins-bot has submitted this change and it was merged. Change subject: Update English languages to only keep a small number of recognised variants .. Update English languages to only keep a small number of recognised variants I have not touched en_US English (United States) en_GB English (United Kingdom) en_CA English (Canada) en_AU English (Australia) or the ones with data in CldrData.php Bug: T96410 Change-Id: Ie2ddb017eeba24ed3b996917cd57c71d956f109b --- M sites/all/modules/wmf_civicrm/wmf_civicrm.install 1 file changed, 43 insertions(+), 0 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 26a8724..f192e69 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -2227,3 +2227,46 @@ civicrm_initialize(); CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contact' => array('preferred_language'))); } + +/** + * Clean up weird English variants from preferred_language field. + * + * Good bye Dutch English, Uzbekastani English etc. + * + * Bug: T96410 + */ +function wmf_civicrm_update_7270() { + $nonUsefulEnglishes = array( +// these ones have information in CldrData.php so don't alter. +//'en_BE', 'en_ZA', 'en_BW', 'en_BZ', 'en_HK', 'en_IN', 'en_JM', 'en_NA', 'en_PK', 'en_SG', 'en_TT', 'en_ZW', +'en_NZ', // :-( +'en_EN', // en_GB instead? Only 3 - who cares. +'en_SE', 'en_NO', 'en_NL', 'en_ES', 'en_IT', 'en_IL', 'en_DK', 'en_FR', 'en_IE', +'en_MY', 'en_BR', 'en_RO', 'en_AT', 'en_HU', 'en_PL', 'en_MX', 'en_PT', 'en_JP', +'en_CN', 'en_CZ', 'en_SK', 'en_GR', 'en_DE', 'en_AE', 'en_UA', 'en_TH', 'en_TW', 'en_LV', 'en_LU', +'en_CH', 'en_PH', 'en_SI', 'en_BG', 'en_AR', 'en_HR', 'en_CL', 'en_CO', 'en_IS', 'en_LT', 'en_CY', +'en_XX', 'en_KW', 'en_UY', 'en_QA', 'en_MT', 'en_PE', 'en_VN', 'en_CR', 'en_RS', 'en_LK', 'en_KZ', +'en_EG', 'en_BH', 'en_DO', 'en_PR', 'en_NG', 'en_VE', 'en_EC', 'en_PA', 'en_OM', +'en_BA', 'en_JO', 'en_KE', 'en_GT', 'en_MU', 'en_GE', 'en_AZ', 'en_AM', 'en_BN', 'en_MK', +'en_NI', 'en_AL', 'en_BD', 'en_BS', 'en_BM', 'en_KH', 'en_BB', 'en_SV', 'en_MD', 'en_HN', 'en_MO', +'en_NP', 'en_VI', 'en_MV', 'en_GI', 'en_KY', 'en_TZ', 'en_ET', 'en_AO', 'en_ME', 'en_MA', +'en_MZ', 'en_AF', 'en_GU', 'en_PY', 'en_AD', 'en_FO', 'en_BO', 'en_MN', 'en_AW', 'en_UG', +'en_FJ', 'en_GN', 'en_PG', 'en_GH', 'en_ZM', 'en_KG', 'en_GY', 'en_JE', 'en_CW', 'en_LC', +'en_IM', 'en_BL', 'en_MC', 'en_SB', 'en_DZ', 'en_GL', 'en_HT', 'en_AG', 'en_GD', 'en_LA', 'en_UZ', +'en_LI', 'en_PF', 'en_KN', 'en_DM', 'en_GG', 'en_NC', 'en_SC', 'en_GP', 'en_TC', 'en_VC', 'en_VG', +'en_VU', 'en_PS', 'en_TN', 'en_MW', 'en_SX', 'en_SM', 'en_SR', 'en_SZ', 'en_FM', 'en_RE', 'en_RW', +'en_SN', 'en_TJ', 'en_CM', 'en_AI', 'en_CK', 'en_LR', 'en_MG', 'en_LS', 'en_SL', 'en_TM', 'en_BJ', +'en_MH', 'en_ML', 'en_WS', 'en_AS', 'en_BF', 'en_BQ', 'en_FK', 'en_GA', 'en_MP', 'en_MQ', 'en_CV', +'en_GF', 'en_MF', 'en_MR', 'en_KR', 'en_NE', 'en_TL', 'en_RU', 'en_AX', 'en_BI', 'en_ID', 'en_TO', +'en_FI', 'en_TR', 'en_SA', 'en_GM', 'en_GQ', 'en_HO', 'en_SP', 'en_AN', 'en_TA', 'en_SJ', 'en_IO', +'en_PW', 'en_JA', 'en_CD', 'en_IR', 'en_UN', 'en_WW', 'en_CG', 'en_DJ', 'en_TD', 'en_TV', 'en_NF', +'en_OS', 'en_DN', 'en_YE', 'en_ER', 'en_VA', 'en_BY', 'en_LB', 'en_IQ', 'en_MM', 'en_EH', 'en_LY', +'en_BT', 'en_CF', 'en_SD', 'en_SS', 'en_KP', 'en_AQ', 'en_SH', 'en_CI', 'en_UM', 'en_WF', +'en_KI', 'en_NU', 'en_SY', 'en_SO', 'en_TG', 'en_CU', 'en_HM', 'en_BV', 'en_MS', + ); + CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = 'en' WHERE preferred_language IN('" +. implode("',", $nonUsefulEnglishes) . "')"); + // This only needs to run on production so hard-coding option_group_id seems OK. + CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET is_active = 0 WHERE option_group_id = 86 AND value IN('" +. implode("',", $nonUsefulEnglishes) . "')"); +} -- To view, visit https://gerrit.wikimedia.org/r/311503 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2ddb017eeba24ed3b996917cd57c71d956f109b Gerrit-PatchSet: 3 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Only store the full country code if it is on our valid list.
jenkins-bot has submitted this change and it was merged. Change subject: Only store the full country code if it is on our valid list. .. Only store the full country code if it is on our valid list. If the country code is not on the list then prefer the 2 digit code. This means 'en' is better than 'en_NO (Norwegian English). Separately we will look to remove the invalid options we already have in our DB. If neither are valid store the full thing to make it easier to find them Bug: T96410 Change-Id: Ie7e8a958c2496a738ce738dd827b7ed04b2d9fbd --- M sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php M sites/all/modules/wmf_civicrm/wmf_civicrm.module 2 files changed, 124 insertions(+), 32 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php index c3ad868..86e8901 100644 --- a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php +++ b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php @@ -103,7 +103,6 @@ 'return' => 'name', )), $expected['contact'][$renamedField]); } - } if ( !empty( $expected['contact_custom_values'] ) ) { @@ -141,35 +140,7 @@ 'payment_method' => 'cc', ), array( -'contribution' => array( -'address_id' => '', -'amount_level' => '', -'campaign_id' => '', -'cancel_date' => '', -'cancel_reason' => '', -'check_number' => '', -'contribution_page_id' => '', -'contribution_recur_id' => '', -'contribution_status_id' => '1', -'contribution_type_id' => $contribution_type_cash, -'currency' => 'USD', -'fee_amount' => '0', -'invoice_id' => '', -'is_pay_later' => '', -'is_test' => '', -'net_amount' => '1.23', -'non_deductible_amount' => '', -'payment_instrument_id' => $payment_instrument_cc, -'receipt_date' => '', -'receive_date' => '2012050100', -'source' => 'USD 1.23', -'thankyou_date' => '', -'total_amount' => '1.23', -'trxn_id' => "TEST_GATEWAY {$gateway_txn_id}", -'financial_type_id' => $contribution_type_cash, -'creditnote_id' => '', -'tax_amount' => '', -), +'contribution' => $this->getBaseContribution($gateway_txn_id), ), ), @@ -219,6 +190,7 @@ 'email' => 'nob...@wikimedia.org', 'first_name' => 'First', 'fee' => '0.03', +'preferred_language' => 'en_US', 'gateway' => 'test_gateway', 'gateway_txn_id' => $gateway_txn_id, 'gift_source' => 'Legacy Gift', @@ -246,6 +218,7 @@ 'middle_name' => 'Middle', 'prefix' => $new_prefix, 'suffix' => 'Sr.', +'preferred_language' => 'en_US', ), 'contribution' => array( 'address_id' => '', @@ -296,8 +269,57 @@ ), ), ), + // Invalid language suffix for valid short lang. + 'invalid language suffix' => array( +array( + 'currency' => 'USD', + 'date' => '2012-05-01 00:00:00', + 'email' => 'nob...@wikimedia.org', + 'gateway' => 'test_gateway', + 'gateway_txn_id' => $gateway_txn_id, + 'gross' => '1.23', + 'payment_method' => 'cc', + 'preferred_language' => 'en_ZZ', + 'name_prefix' => $new_prefix, + 'name_suffix' => 'Sr.', +), +array( + 'contact' => array( +'preferred_language' => 'en', +'prefix' => $new_prefix, +'suffix' => 'Sr.', + ), + 'contribution' => $this->getBaseContribution($gateway_txn_id), +), + ), -// Organization contribution + // Invalid language suffix for invalid short lang. + 'invalid short language' => array( +array( +
[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Update videojs to 5.12.1
jenkins-bot has submitted this change and it was merged. Change subject: Update videojs to 5.12.1 .. Update videojs to 5.12.1 Changelog at * https://github.com/videojs/video.js/releases/tag/v5.12.1 * https://github.com/videojs/video.js/releases/tag/v5.12.0 * https://github.com/videojs/video.js/releases/tag/v5.11.5 * https://github.com/videojs/video.js/releases/tag/v5.11.4 * https://github.com/videojs/video.js/releases/tag/v5.11.3 * https://github.com/videojs/video.js/releases/tag/v5.11.2 * https://github.com/videojs/video.js/releases/tag/v5.11.1 * https://github.com/videojs/video.js/releases/tag/v5.11.0 * https://github.com/videojs/video.js/releases/tag/v5.10.8 * https://github.com/videojs/video.js/releases/tag/v5.10.7 * https://github.com/videojs/video.js/releases/tag/v5.10.6 * https://github.com/videojs/video.js/releases/tag/v5.10.5 * https://github.com/videojs/video.js/releases/tag/v5.10.4 Notable change * @BrandonOCasey fixed source handlers being disposed multiple times when a video is put into the video element directly * @gkatsev nulled out currentSource_ in setSource Change-Id: I16f0ece682f780f56b5d2c29c0b2cad2845a7f22 --- M resources/videojs/lang/de.js M resources/videojs/lang/en.js M resources/videojs/lang/fr.js M resources/videojs/lang/nl.js M resources/videojs/lang/pt-BR.js M resources/videojs/video-js.css M resources/videojs/video-js.swf M resources/videojs/video.js 8 files changed, 20,540 insertions(+), 19,781 deletions(-) Approvals: Brion VIBBER: Looks good to me, approved jenkins-bot: Verified -- To view, visit https://gerrit.wikimedia.org/r/288716 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16f0ece682f780f56b5d2c29c0b2cad2845a7f22 Gerrit-PatchSet: 8 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Paladox Gerrit-Reviewer: TheDJ Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Update videojs-resolution-switcher to upstream master branch
jenkins-bot has submitted this change and it was merged. Change subject: Update videojs-resolution-switcher to upstream master branch .. Update videojs-resolution-switcher to upstream master branch See https://github.com/kmoskwiak/videojs-resolution-switcher/commits/master/lib Change-Id: I151d1770073740807a4ae6fbe1ebfb61dd2b5ba6 --- M resources/videojs-resolution-switcher/videojs-resolution-switcher.css M resources/videojs-resolution-switcher/videojs-resolution-switcher.js 2 files changed, 239 insertions(+), 236 deletions(-) Approvals: Brion VIBBER: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/videojs-resolution-switcher/videojs-resolution-switcher.css b/resources/videojs-resolution-switcher/videojs-resolution-switcher.css index aee4eac..3c7ef67 100644 --- a/resources/videojs-resolution-switcher/videojs-resolution-switcher.css +++ b/resources/videojs-resolution-switcher/videojs-resolution-switcher.css @@ -1,37 +1,31 @@ -.vjs-resolution-button { - color: #ccc; - font-family: VideoJS; -} - -.vjs-resolution-button .vjs-resolution-button-staticlabel:before { +.vjs-resolution-button .vjs-menu-icon:before { content: '\f110'; + font-family: VideoJS; + font-weight: normal; + font-style: normal; font-size: 1.8em; - line-height: 1.67; + line-height: 1.67em; } .vjs-resolution-button .vjs-resolution-button-label { -font-size: 1em; -line-height: 3em; -position: absolute; -top: 0; -left: 0; -width: 100%; -height: 100%; -text-align: center; -box-sizing: inherit; - font-family: Arial, Helvetica, sans-serif; -} - -.vjs-resolution-button ul.vjs-menu-content { - width: 4em !important; -} - -.vjs-resolution-button .vjs-menu { + font-size: 1em; + line-height: 3em; + position: absolute; + top: 0; left: 0; + width: 100%; + height: 100%; + text-align: center; + box-sizing: inherit; +} + +.vjs-resolution-button .vjs-menu .vjs-menu-content { + width: 4em; + left: 50%; /* Center the menu, in it's parent */ + margin-left: -2em; /* half of width, to center */ } .vjs-resolution-button .vjs-menu li { text-transform: none; - font-size: 1em; - font-family: Arial, Helvetica, sans-serif; + font-size: 1em; } diff --git a/resources/videojs-resolution-switcher/videojs-resolution-switcher.js b/resources/videojs-resolution-switcher/videojs-resolution-switcher.js index 5b1448e..eae1c38 100644 --- a/resources/videojs-resolution-switcher/videojs-resolution-switcher.js +++ b/resources/videojs-resolution-switcher/videojs-resolution-switcher.js @@ -1,6 +1,6 @@ /*! videojs-resolution-switcher - 2015-7-26 * Copyright (c) 2016 Kasper Moskwiak - * Modified by Pierre Kraft + * Modified by Pierre Kraft and Derk-Jan Hartman * Licensed under the Apache-2.0 license. */ (function() { @@ -15,143 +15,88 @@ } (function(window, videojs) { - - -var defaults = {}, -videoJsResolutionSwitcher, -currentResolution = {}, // stores current resolution -menuItemsHolder = {}; // stores menuItems - -function setSourcesSanitized(player, sources, label, customSourcePicker) { - currentResolution = { -label: label, -sources: sources +var videoJsResolutionSwitcher, + defaults = { +ui: true }; - if(typeof customSourcePicker === 'function'){ -return customSourcePicker(player, sources, label); - } - return player.src(sources.map(function(src) { -return {src: src.src, type: src.type, res: src.res}; - })); -} - /* - * Resolution menu item - */ - var MenuItem = videojs.getComponent('MenuItem'); - var ResolutionMenuItem = videojs.extend(MenuItem, { -constructor: function(player, options, onClickListener, label){ - this.onClickListener = onClickListener; - this.label = label; - // Sets this.player_, this.options_ and initializes the component - MenuItem.call(this, player, options); - this.src = options.src; +/* + * Resolution menu item + */ +var MenuItem = videojs.getComponent('MenuItem'); +var ResolutionMenuItem = videojs.extend(MenuItem, { + constructor: function(player, options){ +options.selectable = true; +// Sets this.player_, this.options_ and initializes the component +MenuItem.call(this, player, options); +this.src = options.src; - this.on('click', this.onClick); - this.on('touchstart', this.onClick); - - if (options.initialySelected) { -this.showAsLabel(); -this.selected(true); - -this.addClass('vjs-selected'); +player.on('resolutionchange', videojs.bind(this, this.update)); } -}, -showAsLabel: function() { - // Change menu button label to the label of this item if the menu button label is provided - if(this.label) { -this.label.innerHTML = this.options_.label; -
[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[master]: Fix bad ternary
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/312139 Change subject: Fix bad ternary .. Fix bad ternary We were mixing ternary and concatenation, and the operator binding was causing garbage to spew. Change-Id: Ie351dd78f92b30516feda83453da08586e15aad9 --- M special/SpecialBannerLoader.php 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/39/312139/1 diff --git a/special/SpecialBannerLoader.php b/special/SpecialBannerLoader.php index 6f7967f..3c4dc39 100644 --- a/special/SpecialBannerLoader.php +++ b/special/SpecialBannerLoader.php @@ -169,8 +169,10 @@ function __construct( $bannerName = '(none provided)', $extraMsg = null ) { $this->message = get_called_class() . - " while loading banner: '{$bannerName}'" . - $extraMsg ? ". {$extraMsg}" : ""; + " while loading banner: '{$bannerName}'"; + if ( $extraMsg ) { + $this->message .= ". {$extraMsg}"; + } } } -- To view, visit https://gerrit.wikimedia.org/r/312139 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie351dd78f92b30516feda83453da08586e15aad9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: setting kubernetes test host ip addresses
RobH has submitted this change and it was merged. Change subject: setting kubernetes test host ip addresses .. setting kubernetes test host ip addresses setting internal ips for hosts wmf4747/wmf4748/wmf4749/wmf4750 T146171 Change-Id: I9e35c0870b9b82ccc2de5e270c1392aea85f1d16 --- M templates/10.in-addr.arpa M templates/wmnet 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: RobH: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa index adec62a..bad2e05 100644 --- a/templates/10.in-addr.arpa +++ b/templates/10.in-addr.arpa @@ -520,6 +520,7 @@ 71 1H IN PTR elastic1047.eqiad.wmnet. 72 1H IN PTR elastic1028.eqiad.wmnet. 73 1H IN PTR puppetmaster1001.eqiad.wmnet. +74 1H IN PTR wmf4747.eqiad.wmnet. 77 1H IN PTR mw1097.eqiad.wmnet. 78 1H IN PTR mw1098.eqiad.wmnet. @@ -789,6 +790,8 @@ 120 1H IN PTR elastic1021.eqiad.wmnet. 121 1H IN PTR elastic1022.eqiad.wmnet. 122 1H IN PTR elastic1029.eqiad.wmnet. +123 1H IN PTR wmf4748.eqiad.wmnet. +124 1H IN PTR wmf4749.eqiad.wmnet. 135 1H IN PTR hassium.eqiad.wmnet. ; VM on the ganeti01.svc.eqiad.wmnet cluster 136 1H IN PTR db1078.eqiad.wmnet. @@ -1009,7 +1012,7 @@ 43 1H IN PTR ocg1003.eqiad.wmnet. 44 1H IN PTR elastic1020.eqiad.wmnet. 45 1H IN PTR puppetmaster1002.eqiad.wmnet. - +45 1H IN PTR wmf4750.eqiad.wmnet. 47 1H IN PTR elastic1023.eqiad.wmnet. 48 1H IN PTR elastic1024.eqiad.wmnet. 49 1H IN PTR elastic1025.eqiad.wmnet. diff --git a/templates/wmnet b/templates/wmnet index 84c198f..021efb0 100644 --- a/templates/wmnet +++ b/templates/wmnet @@ -820,6 +820,10 @@ labvirt1014 1H IN A10.64.20.30 wdqs10011H IN A10.64.48.112 wdqs10021H IN A10.64.32.183 +wmf4747 1H IN A10.64.16.74 +wmf4748 1H IN A10.64.32.123 +wmf4749 1H IN A10.64.32.124 +wmf4750 1H IN A10.64.48.45 wtp1001 1H IN A10.64.32.78 wtp1002 1H IN A10.64.32.73 wtp1003 1H IN A10.64.32.74 -- To view, visit https://gerrit.wikimedia.org/r/312138 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e35c0870b9b82ccc2de5e270c1392aea85f1d16 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: RobHGerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: setting kubernetes test host ip addresses
RobH has uploaded a new change for review. https://gerrit.wikimedia.org/r/312138 Change subject: setting kubernetes test host ip addresses .. setting kubernetes test host ip addresses setting internal ips for hosts wmf4747/wmf4748/wmf4749/wmf4750 T146171 Change-Id: I9e35c0870b9b82ccc2de5e270c1392aea85f1d16 --- M templates/10.in-addr.arpa M templates/wmnet 2 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/38/312138/1 diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa index adec62a..bad2e05 100644 --- a/templates/10.in-addr.arpa +++ b/templates/10.in-addr.arpa @@ -520,6 +520,7 @@ 71 1H IN PTR elastic1047.eqiad.wmnet. 72 1H IN PTR elastic1028.eqiad.wmnet. 73 1H IN PTR puppetmaster1001.eqiad.wmnet. +74 1H IN PTR wmf4747.eqiad.wmnet. 77 1H IN PTR mw1097.eqiad.wmnet. 78 1H IN PTR mw1098.eqiad.wmnet. @@ -789,6 +790,8 @@ 120 1H IN PTR elastic1021.eqiad.wmnet. 121 1H IN PTR elastic1022.eqiad.wmnet. 122 1H IN PTR elastic1029.eqiad.wmnet. +123 1H IN PTR wmf4748.eqiad.wmnet. +124 1H IN PTR wmf4749.eqiad.wmnet. 135 1H IN PTR hassium.eqiad.wmnet. ; VM on the ganeti01.svc.eqiad.wmnet cluster 136 1H IN PTR db1078.eqiad.wmnet. @@ -1009,7 +1012,7 @@ 43 1H IN PTR ocg1003.eqiad.wmnet. 44 1H IN PTR elastic1020.eqiad.wmnet. 45 1H IN PTR puppetmaster1002.eqiad.wmnet. - +45 1H IN PTR wmf4750.eqiad.wmnet. 47 1H IN PTR elastic1023.eqiad.wmnet. 48 1H IN PTR elastic1024.eqiad.wmnet. 49 1H IN PTR elastic1025.eqiad.wmnet. diff --git a/templates/wmnet b/templates/wmnet index 84c198f..021efb0 100644 --- a/templates/wmnet +++ b/templates/wmnet @@ -820,6 +820,10 @@ labvirt1014 1H IN A10.64.20.30 wdqs10011H IN A10.64.48.112 wdqs10021H IN A10.64.32.183 +wmf4747 1H IN A10.64.16.74 +wmf4748 1H IN A10.64.32.123 +wmf4749 1H IN A10.64.32.124 +wmf4750 1H IN A10.64.48.45 wtp1001 1H IN A10.64.32.78 wtp1002 1H IN A10.64.32.73 wtp1003 1H IN A10.64.32.74 -- To view, visit https://gerrit.wikimedia.org/r/312138 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e35c0870b9b82ccc2de5e270c1392aea85f1d16 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: RobH___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: Revert "setting ip addresses for temp kubernetes hosts"
RobH has submitted this change and it was merged. Change subject: Revert "setting ip addresses for temp kubernetes hosts" .. Revert "setting ip addresses for temp kubernetes hosts" This reverts commit c925ab86fba291f456d6a856d732a5dc61ce9774. Change-Id: I0fd4c4ffa43871f84abee832c2207bbb45663712 --- M templates/10.in-addr.arpa M templates/wmnet 2 files changed, 0 insertions(+), 9 deletions(-) Approvals: RobH: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa index fb88735..adec62a 100644 --- a/templates/10.in-addr.arpa +++ b/templates/10.in-addr.arpa @@ -316,7 +316,6 @@ 84 1H IN PTR mc1023.eqiad.wmnet. 85 1H IN PTR elastic1044.eqiad.wmnet. 86 1H IN PTR elastic1045.eqiad.wmnet. -87 1H IN PTR wmf4747.eqiad.wmnet. 91 1H IN PTR db1079.eqiad.wmnet. 92 1H IN PTR db1080.eqiad.wmnet. @@ -486,8 +485,6 @@ 35 1H IN PTR db1046.eqiad.wmnet. 36 1H IN PTR db1047.eqiad.wmnet. 37 1H IN PTR db1048.eqiad.wmnet. -38 1H IN PTR wmf4748.eqiad.wmnet. -39 1H IN PTR wmf4749.eqiad.wmnet. 40 1H IN PTR ms-be1020.eqiad.wmnet. 41 1H IN PTR kafka1002.eqiad.wmnet. @@ -792,7 +789,6 @@ 120 1H IN PTR elastic1021.eqiad.wmnet. 121 1H IN PTR elastic1022.eqiad.wmnet. 122 1H IN PTR elastic1029.eqiad.wmnet. -123 1H IN PTR wmf4750.eqiad.wmnet. 135 1H IN PTR hassium.eqiad.wmnet. ; VM on the ganeti01.svc.eqiad.wmnet cluster 136 1H IN PTR db1078.eqiad.wmnet. diff --git a/templates/wmnet b/templates/wmnet index b64eaed..84c198f 100644 --- a/templates/wmnet +++ b/templates/wmnet @@ -820,11 +820,6 @@ labvirt1014 1H IN A10.64.20.30 wdqs10011H IN A10.64.48.112 wdqs10021H IN A10.64.32.183 -wmf4747 1H IN A10.64.0.87 -wmf4748 1H IN A10.64.16.38 -wmf4749 1H IN A10.64.16.39 -wmf4750 1H IN A10.64.32.123 - wtp1001 1H IN A10.64.32.78 wtp1002 1H IN A10.64.32.73 wtp1003 1H IN A10.64.32.74 -- To view, visit https://gerrit.wikimedia.org/r/312137 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0fd4c4ffa43871f84abee832c2207bbb45663712 Gerrit-PatchSet: 2 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: RobHGerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: Revert "setting ip addresses for temp kubernetes hosts"
RobH has uploaded a new change for review. https://gerrit.wikimedia.org/r/312137 Change subject: Revert "setting ip addresses for temp kubernetes hosts" .. Revert "setting ip addresses for temp kubernetes hosts" This reverts commit c925ab86fba291f456d6a856d732a5dc61ce9774. Change-Id: I0fd4c4ffa43871f84abee832c2207bbb45663712 --- M templates/10.in-addr.arpa M templates/wmnet 2 files changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/37/312137/1 diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa index fb88735..adec62a 100644 --- a/templates/10.in-addr.arpa +++ b/templates/10.in-addr.arpa @@ -316,7 +316,6 @@ 84 1H IN PTR mc1023.eqiad.wmnet. 85 1H IN PTR elastic1044.eqiad.wmnet. 86 1H IN PTR elastic1045.eqiad.wmnet. -87 1H IN PTR wmf4747.eqiad.wmnet. 91 1H IN PTR db1079.eqiad.wmnet. 92 1H IN PTR db1080.eqiad.wmnet. @@ -486,8 +485,6 @@ 35 1H IN PTR db1046.eqiad.wmnet. 36 1H IN PTR db1047.eqiad.wmnet. 37 1H IN PTR db1048.eqiad.wmnet. -38 1H IN PTR wmf4748.eqiad.wmnet. -39 1H IN PTR wmf4749.eqiad.wmnet. 40 1H IN PTR ms-be1020.eqiad.wmnet. 41 1H IN PTR kafka1002.eqiad.wmnet. @@ -792,7 +789,6 @@ 120 1H IN PTR elastic1021.eqiad.wmnet. 121 1H IN PTR elastic1022.eqiad.wmnet. 122 1H IN PTR elastic1029.eqiad.wmnet. -123 1H IN PTR wmf4750.eqiad.wmnet. 135 1H IN PTR hassium.eqiad.wmnet. ; VM on the ganeti01.svc.eqiad.wmnet cluster 136 1H IN PTR db1078.eqiad.wmnet. diff --git a/templates/wmnet b/templates/wmnet index 81137e1..b1f0f01 100644 --- a/templates/wmnet +++ b/templates/wmnet @@ -821,11 +821,6 @@ labvirt1014 1H IN A10.64.20.30 wdqs10011H IN A10.64.48.112 wdqs10021H IN A10.64.32.183 -wmf4747 1H IN A10.64.0.87 -wmf4748 1H IN A10.64.16.38 -wmf4749 1H IN A10.64.16.39 -wmf4750 1H IN A10.64.32.123 - wtp1001 1H IN A10.64.32.78 wtp1002 1H IN A10.64.32.73 wtp1003 1H IN A10.64.32.74 -- To view, visit https://gerrit.wikimedia.org/r/312137 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0fd4c4ffa43871f84abee832c2207bbb45663712 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: RobH___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/debian[xenial]: Update for xenial
Legoktm has submitted this change and it was merged. Change subject: Update for xenial .. Update for xenial Change-Id: I0dd5a1d485111796cc8c74afb6af3f17e97f666e --- M debian/changelog M debian/gbp.conf 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/debian/changelog b/debian/changelog index bcfd046..5f715f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mediawiki (1:1.27.1-2ppa2~xenial1) xenial; urgency=medium + + * Rebuild for xenial + + -- Kunal MehtaSat, 17 Sep 2016 16:47:47 -0700 + mediawiki (1:1.27.1-2) unstable; urgency=high * Add missing php-xml dependency (Closes: #835912) diff --git a/debian/gbp.conf b/debian/gbp.conf index 8e45551..64eda98 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,3 +1,4 @@ [DEFAULT] -debian-branch = master +debian-branch = xenial sign-tags = true +dist = xenial -- To view, visit https://gerrit.wikimedia.org/r/311315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0dd5a1d485111796cc8c74afb6af3f17e97f666e Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/debian Gerrit-Branch: xenial Gerrit-Owner: Legoktm Gerrit-Reviewer: Hashar Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move SwiftFileBackend to /libs
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312136 Change subject: Move SwiftFileBackend to /libs .. Move SwiftFileBackend to /libs Change-Id: Ied0be9891d70930caf415d75cb3b89043347f47e --- M autoload.php R includes/libs/filebackend/SwiftFileBackend.php 2 files changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/36/312136/1 diff --git a/autoload.php b/autoload.php index 9a9694e..2fb4083 100644 --- a/autoload.php +++ b/autoload.php @@ -433,11 +433,11 @@ 'ExternalStoreMedium' => __DIR__ . '/includes/externalstore/ExternalStoreMedium.php', 'ExternalStoreMwstore' => __DIR__ . '/includes/externalstore/ExternalStoreMwstore.php', 'FSFile' => __DIR__ . '/includes/filebackend/FSFile.php', - 'FSFileBackend' => __DIR__ . '/includes/filebackend/FSFileBackend.php', - 'FSFileBackendDirList' => __DIR__ . '/includes/filebackend/FSFileBackend.php', - 'FSFileBackendFileList' => __DIR__ . '/includes/filebackend/FSFileBackend.php', - 'FSFileBackendList' => __DIR__ . '/includes/filebackend/FSFileBackend.php', - 'FSFileOpHandle' => __DIR__ . '/includes/filebackend/FSFileBackend.php', + 'FSFileBackend' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php', + 'FSFileBackendDirList' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php', + 'FSFileBackendFileList' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php', + 'FSFileBackendList' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php', + 'FSFileOpHandle' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php', 'FSLockManager' => __DIR__ . '/includes/libs/lockmanager/FSLockManager.php', 'FSRepo' => __DIR__ . '/includes/filerepo/FSRepo.php', 'FakeAuthTemplate' => __DIR__ . '/includes/specialpage/LoginSignupSpecialPage.php', @@ -921,7 +921,7 @@ 'MemcachedPeclBagOStuff' => __DIR__ . '/includes/libs/objectcache/MemcachedPeclBagOStuff.php', 'MemcachedPhpBagOStuff' => __DIR__ . '/includes/libs/objectcache/MemcachedPhpBagOStuff.php', 'MemoizedCallable' => __DIR__ . '/includes/libs/MemoizedCallable.php', - 'MemoryFileBackend' => __DIR__ . '/includes/filebackend/MemoryFileBackend.php', + 'MemoryFileBackend' => __DIR__ . '/includes/libs/filebackend/MemoryFileBackend.php', 'MergeHistory' => __DIR__ . '/includes/MergeHistory.php', 'MergeHistoryPager' => __DIR__ . '/includes/specials/pagers/MergeHistoryPager.php', 'MergeLogFormatter' => __DIR__ . '/includes/logging/MergeLogFormatter.php', @@ -1392,11 +1392,11 @@ 'SubmitAction' => __DIR__ . '/includes/actions/SubmitAction.php', 'SubpageImportTitleFactory' => __DIR__ . '/includes/title/SubpageImportTitleFactory.php', 'SvgHandler' => __DIR__ . '/includes/media/SVG.php', - 'SwiftFileBackend' => __DIR__ . '/includes/filebackend/SwiftFileBackend.php', - 'SwiftFileBackendDirList' => __DIR__ . '/includes/filebackend/SwiftFileBackend.php', - 'SwiftFileBackendFileList' => __DIR__ . '/includes/filebackend/SwiftFileBackend.php', - 'SwiftFileBackendList' => __DIR__ . '/includes/filebackend/SwiftFileBackend.php', - 'SwiftFileOpHandle' => __DIR__ . '/includes/filebackend/SwiftFileBackend.php', + 'SwiftFileBackend' => __DIR__ . '/includes/libs/filebackend/SwiftFileBackend.php', + 'SwiftFileBackendDirList' => __DIR__ . '/includes/libs/filebackend/SwiftFileBackend.php', + 'SwiftFileBackendFileList' => __DIR__ . '/includes/libs/filebackend/SwiftFileBackend.php', + 'SwiftFileBackendList' => __DIR__ . '/includes/libs/filebackend/SwiftFileBackend.php', + 'SwiftFileOpHandle' => __DIR__ . '/includes/libs/filebackend/SwiftFileBackend.php', 'SwiftVirtualRESTService' => __DIR__ . '/includes/libs/virtualrest/SwiftVirtualRESTService.php', 'SyncFileBackend' => __DIR__ . '/maintenance/syncFileBackend.php', 'TableCleanup' => __DIR__ . '/maintenance/cleanupTable.inc', diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php similarity index 100% rename from includes/filebackend/SwiftFileBackend.php rename to includes/libs/filebackend/SwiftFileBackend.php -- To view, visit https://gerrit.wikimedia.org/r/312136 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied0be9891d70930caf415d75cb3b89043347f47e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Depedencency cleanups to SwiftFileBackend
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312135 Change subject: Depedencency cleanups to SwiftFileBackend .. Depedencency cleanups to SwiftFileBackend Change-Id: I359da1ad77c62880ea799b65cd3a16ad673a64eb --- M includes/filebackend/FileBackendGroup.php M includes/filebackend/SwiftFileBackend.php M includes/libs/filebackend/FileBackend.php M includes/libs/filebackend/FileBackendStore.php 4 files changed, 43 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/35/312135/1 diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index db28d6e..da6bd6c 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -168,6 +168,7 @@ ? FileJournal::factory( $config['fileJournal'], $name ) : FileJournal::factory( [ 'class' => 'NullFileJournal' ], $name ); $config['wanCache'] = ObjectCache::getMainWANInstance(); + $config['srvCache'] = ObjectCache::getLocalServerInstance( 'hash' ); $config['statusWrapper'] = [ 'Status', 'wrap' ]; $config['logger'] = LoggerFactory::getInstance( 'FileOperation' ); $config['profiler'] = Profiler::instance(); diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index a0027e4..def24e2 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -134,14 +134,8 @@ // Process cache for container info $this->containerStatCache = new ProcessCacheLRU( 300 ); // Cache auth token information to avoid RTTs - if ( !empty( $config['cacheAuthInfo'] ) ) { - if ( PHP_SAPI === 'cli' ) { - // Preferrably memcached - $this->srvCache = ObjectCache::getLocalClusterInstance(); - } else { - // Look for APC, XCache, WinCache, ect... - $this->srvCache = ObjectCache::getLocalServerInstance( CACHE_NONE ); - } + if ( !empty( $config['cacheAuthInfo'] ) && isset( $config['srvCache'] ) ) { + $this->srvCache = $config['srvCache']; } else { $this->srvCache = new EmptyBagOStuff(); } @@ -576,7 +570,7 @@ return $status; // already there } elseif ( $stat === null ) { $status->fatal( 'backend-fail-internal', $this->name ); - wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); + $this->logger->error( __METHOD__ . ': cannot get container stat' ); return $status; } @@ -608,7 +602,7 @@ $status->fatal( 'backend-fail-usable', $params['dir'] ); } else { $status->fatal( 'backend-fail-internal', $this->name ); - wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); + $this->logger->error( __METHOD__ . ': cannot get container stat' ); } return $status; @@ -629,7 +623,7 @@ $status->fatal( 'backend-fail-usable', $params['dir'] ); } else { $status->fatal( 'backend-fail-internal', $this->name ); - wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); + $this->logger->error( __METHOD__ . ': cannot get container stat' ); } return $status; @@ -649,7 +643,7 @@ return $status; // ok, nothing to do } elseif ( !is_array( $stat ) ) { $status->fatal( 'backend-fail-internal', $this->name ); - wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); + $this->logger->error( __METHOD__ . ': cannot get container stat' ); return $status; } @@ -704,8 +698,8 @@ } /** @noinspection PhpUnusedLocalVariableInspection */ - $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" ); - wfDebugLog( 'SwiftBackend', __METHOD__ . ": $path was not stored with SHA-1 metadata." ); + $ps = $this->scopedProfileSection( __METHOD__ . "-{$this->name}" ); + $this->logger->error( __METHOD__ . ": $path was not stored with SHA-1 metadata." );
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove wf* function usage from FSFileBackend
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312133 Change subject: Remove wf* function usage from FSFileBackend .. Remove wf* function usage from FSFileBackend Change-Id: Iad6471724f8cdc596c755e6194da7556158e9203 --- M includes/filebackend/FSFileBackend.php M includes/filebackend/FileBackendGroup.php 2 files changed, 44 insertions(+), 37 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/33/312133/1 diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index b0e3eee..142376d 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -47,10 +47,14 @@ /** @var int File permission mode */ protected $fileMode; + /** @var int File permission mode */ + protected $dirMode; /** @var string Required OS username to own files */ protected $fileOwner; + /** @var bool */ + protected $isWindows; /** @var string OS username running this script */ protected $currentUser; @@ -64,11 +68,13 @@ * - containerPaths : Map of container names to custom file system directories. * This should only be used for backwards-compatibility. * - fileMode : Octal UNIX file permissions to use on files stored. +* - directoryMode : Octal UNIX file permissions to use on directories created. * @param array $config */ public function __construct( array $config ) { parent::__construct( $config ); + $this->isWindows = ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ); // Remove any possible trailing slash from directories if ( isset( $config['basePath'] ) ) { $this->basePath = rtrim( $config['basePath'], '/' ); // remove trailing slash @@ -84,6 +90,7 @@ } $this->fileMode = isset( $config['fileMode'] ) ? $config['fileMode'] : 0644; + $this->dirMode = isset( $config['directoryMode'] ) ? $config['directoryMode'] : 0777; if ( isset( $config['fileOwner'] ) && function_exists( 'posix_getuid' ) ) { $this->fileOwner = $config['fileOwner']; // cache this, assuming it doesn't change @@ -92,7 +99,7 @@ } public function getFeatures() { - return !wfIsWindows() ? FileBackend::ATTR_UNICODE_PATHS : 0; + return !$this->isWindows ? FileBackend::ATTR_UNICODE_PATHS : 0; } protected function resolveContainerPath( $container, $relStoragePath ) { @@ -118,7 +125,7 @@ if ( preg_match( '![^/]{256}!', $path ) ) { // ext3/NTFS return false; } - if ( wfIsWindows() ) { // NTFS + if ( $this->isWindows ) { // NTFS return !preg_match( '![:*?"<>|]!', $path ); } else { return true; @@ -210,12 +217,12 @@ return $status; } $cmd = implode( ' ', [ - wfIsWindows() ? 'COPY /B /Y' : 'cp', // (binary, overwrite) - wfEscapeShellArg( $this->cleanPathSlashes( $tempFile->getPath() ) ), - wfEscapeShellArg( $this->cleanPathSlashes( $dest ) ) + $this->isWindows ? 'COPY /B /Y' : 'cp', // (binary, overwrite) + escapeshellarg( $this->cleanPathSlashes( $tempFile->getPath() ) ), + escapeshellarg( $this->cleanPathSlashes( $dest ) ) ] ); $handler = function ( $errors, StatusValue $status, array $params, $cmd ) { - if ( $errors !== '' && !( wfIsWindows() && $errors[0] === " " ) ) { + if ( $errors !== '' && !( $this->isWindows && $errors[0] === " " ) ) { $status->fatal( 'backend-fail-create', $params['dst'] ); trigger_error( "$cmd\n$errors", E_USER_WARNING ); // command output } @@ -249,12 +256,12 @@ if ( !empty( $params['async'] ) ) { // deferred $cmd = implode( ' ', [ - wfIsWindows() ? 'COPY /B /Y' : 'cp', // (binary, overwrite) - wfEscapeShellArg( $this->cleanPathSlashes( $params['src'] ) ), - wfEscapeShellArg( $this->cleanPathSlashes( $dest ) ) + $this->isWindows ? 'COPY /B /Y' : 'cp', // (binary, overwrite) +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move FSFilebackend and MemoryFileBackend to /libs
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312134 Change subject: Move FSFilebackend and MemoryFileBackend to /libs .. Move FSFilebackend and MemoryFileBackend to /libs Change-Id: Id38a2ef9e0e22537d0267b536f8a4dfd60c5b41d --- R includes/libs/filebackend/FSFileBackend.php R includes/libs/filebackend/MemoryFileBackend.php 2 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/34/312134/1 diff --git a/includes/filebackend/FSFileBackend.php b/includes/libs/filebackend/FSFileBackend.php similarity index 100% rename from includes/filebackend/FSFileBackend.php rename to includes/libs/filebackend/FSFileBackend.php diff --git a/includes/filebackend/MemoryFileBackend.php b/includes/libs/filebackend/MemoryFileBackend.php similarity index 100% rename from includes/filebackend/MemoryFileBackend.php rename to includes/libs/filebackend/MemoryFileBackend.php -- To view, visit https://gerrit.wikimedia.org/r/312134 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id38a2ef9e0e22537d0267b536f8a4dfd60c5b41d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Blacklist minerva from showing Related Articles in the footer
jenkins-bot has submitted this change and it was merged. Change subject: Blacklist minerva from showing Related Articles in the footer .. Blacklist minerva from showing Related Articles in the footer See I1663ab25083d9d907f288e60d506831bebb67945. Bug: T144912 Change-Id: Ie4ac3c11e81eeea9f5b4a7161a64477cb5d60f07 --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 5 insertions(+), 0 deletions(-) Approvals: Jhobs: Looks good to me, but someone else must approve Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index d1587d8..7d6f19e 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -2795,6 +2795,7 @@ if ( $wmgRelatedArticlesShowInFooter ) { wfLoadExtension( 'Cards' ); + $wgRelatedArticlesFooterBlacklistedSkins = $wmgRelatedArticlesFooterBlacklistedSkins; $wgRelatedArticlesShowInSidebar = false; $wgRelatedArticlesShowInFooter = true; $wgRelatedArticlesLoggingSamplingRate = 0.01; diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index bbb2db1..b27a152 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -16114,6 +16114,10 @@ 'frwikinews' => true, // T143480 ], +'wmgRelatedArticlesFooterBlacklistedSkins' => [ + 'default' => [ 'minerva' ] +], + 'wmgUseRelatedSites' => [ 'default' => false, 'wikivoyage' => true, -- To view, visit https://gerrit.wikimedia.org/r/311197 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie4ac3c11e81eeea9f5b4a7161a64477cb5d60f07 Gerrit-PatchSet: 3 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: BmansurovGerrit-Reviewer: Bmansurov Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Jhobs Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/debian[trusty]: Rebuild for trusty
Legoktm has submitted this change and it was merged. Change subject: Rebuild for trusty .. Rebuild for trusty Change-Id: I64c0a4ad42b94d4a44e30add6ee4d25ea1d95af5 --- M debian/changelog M debian/gbp.conf 2 files changed, 8 insertions(+), 2 deletions(-) Approvals: Legoktm: Verified; Looks good to me, approved diff --git a/debian/changelog b/debian/changelog index ccadfc9..ec3cf6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mediawiki (1:1.27.1-2ppa2~trusty1) trusty; urgency=medium + + * Rebuild for trusty + + -- Kunal MehtaSun, 18 Sep 2016 00:08:55 -0700 + mediawiki (1:1.27.1-2~bpo8+1) jessie-backports; urgency=medium * Rebuild for jessie-backports. diff --git a/debian/gbp.conf b/debian/gbp.conf index a492122..eca4365 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,4 +1,4 @@ [DEFAULT] -debian-branch = jessie -dist = jessie +debian-branch = trusty +dist = trusty sign-tags = true -- To view, visit https://gerrit.wikimedia.org/r/312132 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64c0a4ad42b94d4a44e30add6ee4d25ea1d95af5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/debian Gerrit-Branch: trusty Gerrit-Owner: Legoktm Gerrit-Reviewer: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/debian[trusty]: Rebuild for trusty
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312132 Change subject: Rebuild for trusty .. Rebuild for trusty Change-Id: I64c0a4ad42b94d4a44e30add6ee4d25ea1d95af5 --- M debian/changelog M debian/gbp.conf 2 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/debian refs/changes/32/312132/1 diff --git a/debian/changelog b/debian/changelog index ccadfc9..ec3cf6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mediawiki (1:1.27.1-2ppa2~trusty1) trusty; urgency=medium + + * Rebuild for trusty + + -- Kunal MehtaSun, 18 Sep 2016 00:08:55 -0700 + mediawiki (1:1.27.1-2~bpo8+1) jessie-backports; urgency=medium * Rebuild for jessie-backports. diff --git a/debian/gbp.conf b/debian/gbp.conf index a492122..eca4365 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,4 +1,4 @@ [DEFAULT] -debian-branch = jessie -dist = jessie +debian-branch = trusty +dist = trusty sign-tags = true -- To view, visit https://gerrit.wikimedia.org/r/312132 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64c0a4ad42b94d4a44e30add6ee4d25ea1d95af5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/debian Gerrit-Branch: trusty Gerrit-Owner: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/debian[jessie]: Rebuild for trusty
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312131 Change subject: Rebuild for trusty .. Rebuild for trusty Change-Id: I81dc93863b33ef3494c2c02070b6159dff3da3bc --- M debian/changelog M debian/gbp.conf 2 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/debian refs/changes/31/312131/1 diff --git a/debian/changelog b/debian/changelog index ccadfc9..ec3cf6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mediawiki (1:1.27.1-2ppa2~trusty1) trusty; urgency=medium + + * Rebuild for trusty + + -- Kunal MehtaSun, 18 Sep 2016 00:08:55 -0700 + mediawiki (1:1.27.1-2~bpo8+1) jessie-backports; urgency=medium * Rebuild for jessie-backports. diff --git a/debian/gbp.conf b/debian/gbp.conf index a492122..eca4365 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,4 +1,4 @@ [DEFAULT] -debian-branch = jessie -dist = jessie +debian-branch = trusty +dist = trusty sign-tags = true -- To view, visit https://gerrit.wikimedia.org/r/312131 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I81dc93863b33ef3494c2c02070b6159dff3da3bc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/debian Gerrit-Branch: jessie Gerrit-Owner: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: mail.wikimedia.org cert expires on Thursday 2016-09-22
Faidon Liambotis has submitted this change and it was merged. Change subject: mail.wikimedia.org cert expires on Thursday 2016-09-22 .. mail.wikimedia.org cert expires on Thursday 2016-09-22 New certificate file for mail servers. This uses the existing private key, so no private repo updates are required. Existing key expires on 2016-09-22 at 10AM Pacific. Bug:T144568 Change-Id: I97774fc76af953805a7deddc49abf5aa8325bb8f --- M files/ssl/mail.wikimedia.org.crt 1 file changed, 31 insertions(+), 31 deletions(-) Approvals: Faidon Liambotis: Verified; Looks good to me, approved diff --git a/files/ssl/mail.wikimedia.org.crt b/files/ssl/mail.wikimedia.org.crt index 525fe4b..c842421 100644 --- a/files/ssl/mail.wikimedia.org.crt +++ b/files/ssl/mail.wikimedia.org.crt @@ -1,33 +1,33 @@ -BEGIN CERTIFICATE- -MIIFnjCCBIagAwIBAgISESF0Wc8iUHLjme6ek+epUIa9MA0GCSqGSIb3DQEBCwUA -MGYxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTwwOgYD -VQQDEzNHbG9iYWxTaWduIE9yZ2FuaXphdGlvbiBWYWxpZGF0aW9uIENBIC0gU0hB -MjU2IC0gRzIwHhcNMTUwOTIyMTgwMTEzWhcNMTYwOTIyMTgwMTEzWjB8MQswCQYD -VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5j -aXNjbzEjMCEGA1UEChMaV2lraW1lZGlhIEZvdW5kYXRpb24sIEluYy4xGzAZBgNV -BAMTEm1haWwud2lraW1lZGlhLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKGQx0pHDwyOUbCEqSFxUV/33Wz4JxHi1ynljGFpLNIR3OJ+0NR1zBYG -yCsjEnbcof8UhgxCc6u/GAA4A4CGKb1zbfG3xq8ZUyzc6QsOKsgPPiBsN85NRtna -iDN0teDB5HeU+/F1e0QrrYdeEVDp/K3H0pIpoPNncIs3/t3qFdKJzVhZW6Mj1yRG -0RcLoI+uz7pbsJobEUkNYx0Ycx8LYII3gunwwWbq7QwNGYzELhyBAAY/Vm1XMCKM -MJ0pkcbTXoU+04Yo6DC4LjU2Tz1cjJCOmc8ddhPSFOtw7XwOXqgnA8SGxXhKaUiW -xYw7jWzN5D6fSumRoFJ4s8ZfQioEd58CAwEAAaOCAi4wggIqMA4GA1UdDwEB/wQE -AwIFoDBJBgNVHSAEQjBAMD4GBmeBDAECAjA0MDIGCCsGAQUFBwIBFiZodHRwczov -L3d3dy5nbG9iYWxzaWduLmNvbS9yZXBvc2l0b3J5LzB1BgNVHREEbjBsghJtYWls -Lndpa2ltZWRpYS5vcmeCFG14MTAwMS53aWtpbWVkaWEub3JnghRteDEwMDIud2lr -aW1lZGlhLm9yZ4IUbXgyMDAxLndpa2ltZWRpYS5vcmeCFG14MjAwMi53aWtpbWVk -aWEub3JnMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC -MEkGA1UdHwRCMEAwPqA8oDqGOGh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5jb20vZ3Mv -Z3Nvcmdhbml6YXRpb252YWxzaGEyZzIuY3JsMIGgBggrBgEFBQcBAQSBkzCBkDBN -BggrBgEFBQcwAoZBaHR0cDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQv -Z3Nvcmdhbml6YXRpb252YWxzaGEyZzJyMS5jcnQwPwYIKwYBBQUHMAGGM2h0dHA6 -Ly9vY3NwMi5nbG9iYWxzaWduLmNvbS9nc29yZ2FuaXphdGlvbnZhbHNoYTJnMjAd -BgNVHQ4EFgQUj485M4wC9Myee9NKPSHdIo9McFYwHwYDVR0jBBgwFoAUlt5h8b0c -FilTHMDMfTuDAEDmGnwwDQYJKoZIhvcNAQELBQADggEBAAl74GQp8Lmuih2t2PlL -AaEwp3W6BIVJYherqMbvA6etMqGxg9KLwPkLCZZoHf55dVDzKST+ZTh3RRGlMfXF -N9TDVAudAdOS8dcpdFRRDfJfdHyoUMnAK7jE+Lhco8VLOKOSeQRXaHsmnkRYbfgN -vBE3UkQTzdVx1Ptf+YUQX3DmSlhyajgJIGidiZOS1pNM526y5fyMm4meYIR3bulz -dqsCOZL9BZTAGOAkWYNytOETB3Lnr2MLk+bV7vXqEtbg9jfTv7RX8lqDuYVeaDoA -G7MrwPCgww3dcWgeKveGnFgjOR/gwee/iEnYyEIkM05sqP+aNQ9W+jJeE6DAM6uC -+nw= +MIIFpTCCBI2gAwIBAgIMPXYJjpGz3zcUKve0MA0GCSqGSIb3DQEBCwUAMGYxCzAJ +BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTwwOgYDVQQDEzNH +bG9iYWxTaWduIE9yZ2FuaXphdGlvbiBWYWxpZGF0aW9uIENBIC0gU0hBMjU2IC0g +RzIwHhcNMTYwOTIwMTU0NjA2WhcNMTcxMDIzMTgwMTEzWjB8MQswCQYDVQQGEwJV +UzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEj +MCEGA1UEChMaV2lraW1lZGlhIEZvdW5kYXRpb24sIEluYy4xGzAZBgNVBAMTEm1h +aWwud2lraW1lZGlhLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKGQx0pHDwyOUbCEqSFxUV/33Wz4JxHi1ynljGFpLNIR3OJ+0NR1zBYGyCsjEnbc +of8UhgxCc6u/GAA4A4CGKb1zbfG3xq8ZUyzc6QsOKsgPPiBsN85NRtnaiDN0teDB +5HeU+/F1e0QrrYdeEVDp/K3H0pIpoPNncIs3/t3qFdKJzVhZW6Mj1yRG0RcLoI+u +z7pbsJobEUkNYx0Ycx8LYII3gunwwWbq7QwNGYzELhyBAAY/Vm1XMCKMMJ0pkcbT +XoU+04Yo6DC4LjU2Tz1cjJCOmc8ddhPSFOtw7XwOXqgnA8SGxXhKaUiWxYw7jWzN +5D6fSumRoFJ4s8ZfQioEd58CAwEAAaOCAjswggI3MA4GA1UdDwEB/wQEAwIFoDCB +oAYIKwYBBQUHAQEEgZMwgZAwTQYIKwYBBQUHMAKGQWh0dHA6Ly9zZWN1cmUuZ2xv +YmFsc2lnbi5jb20vY2FjZXJ0L2dzb3JnYW5pemF0aW9udmFsc2hhMmcycjEuY3J0 +MD8GCCsGAQUFBzABhjNodHRwOi8vb2NzcDIuZ2xvYmFsc2lnbi5jb20vZ3Nvcmdh +bml6YXRpb252YWxzaGEyZzIwVgYDVR0gBE8wTTBBBgkrBgEEAaAyARQwNDAyBggr +BgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFsc2lnbi5jb20vcmVwb3NpdG9yeS8w +CAYGZ4EMAQICMAkGA1UdEwQCMAAwSQYDVR0fBEIwQDA+oDygOoY4aHR0cDovL2Ny +bC5nbG9iYWxzaWduLmNvbS9ncy9nc29yZ2FuaXphdGlvbnZhbHNoYTJnMi5jcmww +dQYDVR0RBG4wbIISbWFpbC53aWtpbWVkaWEub3JnghRteDEwMDEud2lraW1lZGlh +Lm9yZ4IUbXgxMDAyLndpa2ltZWRpYS5vcmeCFG14MjAwMS53aWtpbWVkaWEub3Jn +ghRteDIwMDIud2lraW1lZGlhLm9yZzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB +BQUHAwIwHQYDVR0OBBYEFI+POTOMAvTMnnvTSj0h3SKPTHBWMB8GA1UdIwQYMBaA +FJbeYfG9HBYpUxzAzH07gwBA5hp8MA0GCSqGSIb3DQEBCwUAA4IBAQAVY0rgBL7K +PJ6Mpn7GaiYJ7zveHm7cB0xhisIjP95iywXvgQMwYWAIa+M8CdCRzLQhHGxaonMR +P37e0dycLdSOM8QaOlhzQMnt3+LXe6pjMxqBtDJAF/O4XfCT1/+VQ/19s4qRxaRf +WKg4lD5bwFEk1I5Q4kAPbQerPfUWNxpe3RLhnzxOaSZ5wBS2LoFAv8aKWAA3AAE3 +efS8x9LGqDKb37KMiwUnYhn9DSv9ii8y1epbH+S/8BSOQChb/BGgaNIsTPa8dxCz +j/4M9CjG72eoYF+LlCy8x5RN7BoNRDL0KHuqV9KV88/algka7oBI22oSHutJPK8d +1XV+bIHgdpmj -END CERTIFICATE- -- To view, visit https://gerrit.wikimedia.org/r/311641 To unsubscribe, visit
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Add the x-restbase-mode header to transclusions and other up...
Mobrovac has submitted this change and it was merged. Change subject: Add the x-restbase-mode header to transclusions and other updates .. Add the x-restbase-mode header to transclusions and other updates Change-Id: I33d874c9b74f4bf7bff615ec7f8895b7dfe69d56 --- M scap/templates/config.yaml.j2 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Mobrovac: Verified; Looks good to me, approved Ppchelko: Looks good to me, but someone else must approve diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2 index ead1f45..c209d1c 100644 --- a/scap/templates/config.yaml.j2 +++ b/scap/templates/config.yaml.j2 @@ -319,6 +319,7 @@ headers: cache-control: no-cache if-unmodified-since: '{{date(message.meta.dt)}}' + x-restbase-mode: '{{message.tags[1]}}' query: redirect: false -- To view, visit https://gerrit.wikimedia.org/r/312125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33d874c9b74f4bf7bff615ec7f8895b7dfe69d56 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/change-propagation/deploy Gerrit-Branch: master Gerrit-Owner: MobrovacGerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ppchelko ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update change-propagation to ffd7a02
Mobrovac has submitted this change and it was merged. Change subject: Update change-propagation to ffd7a02 .. Update change-propagation to ffd7a02 List of changes: ffd7a02 Set x-restbase-mode header (#111) xxx Update node module dependencies Change-Id: I962be129780a30fe803ca82a0170a37edc958656 --- M node_modules/hyperswitch/.travis.yml M node_modules/hyperswitch/lib/hyperswitch.js M node_modules/hyperswitch/lib/swaggerUI.js M node_modules/hyperswitch/node_modules/json-stable-stringify/package.json M node_modules/hyperswitch/node_modules/swagger-ui/package.json M node_modules/hyperswitch/package.json M node_modules/service-runner/node_modules/bunyan/node_modules/moment/min/moment-with-locales.js M node_modules/service-runner/node_modules/bunyan/node_modules/moment/min/moment-with-locales.min.js M node_modules/service-runner/node_modules/bunyan/node_modules/moment/min/moment.min.js M node_modules/service-runner/node_modules/bunyan/node_modules/moment/moment.js M node_modules/service-runner/node_modules/bunyan/node_modules/moment/package.json M node_modules/service-runner/node_modules/bunyan/node_modules/moment/src/lib/locale/locales.js M node_modules/service-runner/node_modules/bunyan/node_modules/moment/src/moment.js M node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json M src 15 files changed, 53 insertions(+), 50 deletions(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/node_modules/hyperswitch/.travis.yml b/node_modules/hyperswitch/.travis.yml index b052b4b..5d92959 100644 --- a/node_modules/hyperswitch/.travis.yml +++ b/node_modules/hyperswitch/.travis.yml @@ -2,9 +2,8 @@ node_js: - "0.10" - "0.12" -- "4.3" - "4" -- "5" +- "6" sudo: false diff --git a/node_modules/hyperswitch/lib/hyperswitch.js b/node_modules/hyperswitch/lib/hyperswitch.js index f637f5f..0affae2 100644 --- a/node_modules/hyperswitch/lib/hyperswitch.js +++ b/node_modules/hyperswitch/lib/hyperswitch.js @@ -83,6 +83,10 @@ this.config = options.conf; this.config.user_agent = this.config.user_agent || 'HyperSwitch'; +// TODO for v >= 0.8.0: replace the next three defaults with HyperSwitch values +this.config.ui_name = this.config.ui_name || 'RESTBase'; +this.config.ui_url = this.config.ui_url || 'https://www.mediawiki.org/wiki/RESTBase'; +this.config.ui_title = this.config.ui_title || 'RESTBase docs'; this._rootReq = null; this._requestFilters = []; this._subRequestFilters = []; diff --git a/node_modules/hyperswitch/lib/swaggerUI.js b/node_modules/hyperswitch/lib/swaggerUI.js index 2dcdf23..187c192 100644 --- a/node_modules/hyperswitch/lib/swaggerUI.js +++ b/node_modules/hyperswitch/lib/swaggerUI.js @@ -22,13 +22,13 @@ .then(function(body) { if (reqPath === '/index.html') { // Rewrite the HTML to use a query string +var cfg = hyper.config; body = body.toString() .replace(/((?:src|href)=['"])/g, '$1?path=') // Some self-promotion .replace(//, -'https://www.mediawiki.org/wiki/RESTBase;>RESTBase') -.replace(/[^<]*<\/title>/, -'RESTBase docs') // TODO: Make this configurable +'' + cfg.ui_name + '') +.replace(/[^<]*<\/title>/, '' + cfg.ui_title + '') // Replace the default url with ours, switch off validation & // limit the size of documents to apply syntax highlighting to .replace(/Sorter: "alpha"/, 'Sorter: "alpha", ' + 'validatorUrl: null, ' + diff --git a/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json b/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json index b0c6056..76bf8d4 100644 --- a/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json +++ b/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json @@ -50,7 +50,7 @@ "url": "https://github.com/substack/json-stable-stringify/issues; }, "_id": "json-stable-stringify@1.0.0", - "_shasum": "246a5aed5f42cd12fd47810afd68464d36ba5f64", + "_shasum": "58e1688e01e0437751e1321f33b380d75a0750ee", "_from": "git+https://github.com/wikimedia/json-stable-stringify.git#master;, "_resolved": "git+https://github.com/wikimedia/json-stable-stringify.git#c05178e4dfc3834017f017732934c1c52ba3dd8f; } diff --git a/node_modules/hyperswitch/node_modules/swagger-ui/package.json b/node_modules/hyperswitch/node_modules/swagger-ui/package.json index 9c764ec..7256abe 100644 --- a/node_modules/hyperswitch/node_modules/swagger-ui/package.json +++ b/node_modules/hyperswitch/node_modules/swagger-ui/package.json @@ -70,7 +70,7 @@ "url": "https://github.com/swagger-api/swagger-ui/issues; }, "_id":
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Let LabelDescriptionLookup work in action=info in client for...
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/312130 Change subject: Let LabelDescriptionLookup work in action=info in client for EntityUsage .. Let LabelDescriptionLookup work in action=info in client for EntityUsage Bug: T145965 Change-Id: I6c03dd7ef67471e51807048816769a496fc1d931 --- M client/WikibaseClient.hooks.php M client/includes/Hooks/InfoActionHookHandler.php M client/includes/RepoLinker.php M client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php 4 files changed, 112 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/30/312130/1 diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index 476e209..1a5ee70 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -31,6 +31,7 @@ use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\EntityId; use Wikibase\Lib\AutoCommentFormatter; +use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory; /** * File defining the hook handlers for the Wikibase Client extension. @@ -409,6 +410,12 @@ $namespaceChecker = $wikibaseClient->getNamespaceChecker(); $usageLookup = $wikibaseClient->getStore()->getUsageLookup(); + $labelDescriptionLookupFactory = new LanguageFallbackLabelDescriptionLookupFactory( + $wikibaseClient->getLanguageFallbackChainFactory(), + $wikibaseClient->getTermLookup(), + $wikibaseClient->getTermBuffer() + ); + $idParser = $wikibaseClient->getEntityIdParser(); if ( !$namespaceChecker->isWikibaseEnabled( $context->getTitle()->getNamespace() ) ) { // shorten out @@ -420,7 +427,9 @@ $wikibaseClient->newRepoLinker(), $wikibaseClient->getStore()->getSiteLinkLookup(), $settings->getSetting( 'siteGlobalID' ), - $usageLookup + $usageLookup, + $labelDescriptionLookupFactory, + $idParser ); $pageInfo = $infoActionHookHandler->handle( $context, $pageInfo ); diff --git a/client/includes/Hooks/InfoActionHookHandler.php b/client/includes/Hooks/InfoActionHookHandler.php index 874fc4b..17ff861 100644 --- a/client/includes/Hooks/InfoActionHookHandler.php +++ b/client/includes/Hooks/InfoActionHookHandler.php @@ -7,8 +7,10 @@ use Title; use Wikibase\Client\RepoLinker; use Wikibase\Client\Usage\UsageLookup; +use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\ItemId; use Wikibase\Lib\Store\SiteLinkLookup; +use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory; use Wikibase\NamespaceChecker; /** @@ -44,13 +46,32 @@ */ private $usageLookup; - public function __construct( NamespaceChecker $namespaceChecker, RepoLinker $repoLinker, - SiteLinkLookup $siteLinkLookup, $siteId, UsageLookup $usageLookup ) { + /** +* @var LanguageFallbackLabelDescriptionLookupFactory +*/ + private $labelDescriptionLookupFactory; + + /** +* @var EntityIdParser +*/ + private $idParser; + + public function __construct( + NamespaceChecker $namespaceChecker, + RepoLinker $repoLinker, + SiteLinkLookup $siteLinkLookup, + $siteId, + UsageLookup $usageLookup, + LanguageFallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory, + EntityIdParser $idParser + ) { $this->namespaceChecker = $namespaceChecker; $this->repoLinker = $repoLinker; $this->siteLinkLookup = $siteLinkLookup; $this->siteId = $siteId; $this->usageLookup = $usageLookup; + $this->labelDescriptionLookupFactory = $labelDescriptionLookupFactory; + $this->idParser = $idParser; } /** @@ -165,12 +186,25 @@ ]; } $output = ''; - + $entityIds = array_map( + function( $entityId ) { + return $this->idParser->parse( $entityId ); + }, + array_keys( $usageAspectsByEntity ) + ); + $labelLookup = $this->labelDescriptionLookupFactory->newLabelDescriptionLookup( + $context->getLanguage(), + $entityIds + ); foreach ( $usageAspectsByEntity as $entityId => $aspects ) { + $label = $labelLookup->getLabel( $this->idParser->parse( $entityId ) );
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add Index to contact.preferred_language
jenkins-bot has submitted this change and it was merged. Change subject: Add Index to contact.preferred_language .. Add Index to contact.preferred_language CRM-19350 Bug: T96410 Change-Id: If686ad6e20c2906221bc0b8c989ee2d913ad11e2 --- M sites/all/modules/wmf_civicrm/wmf_civicrm.install 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 9aeb973..ae26008 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -2213,3 +2213,13 @@ ) "); } + +/** + * T128221 add index to civicrm_contribution.total_amount. + * + * Bug: T96410 + */ +function wmf_civicrm_update_7255() { + civicrm_initialize(); + CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contact' => array('preferred_language'))); +} -- To view, visit https://gerrit.wikimedia.org/r/310192 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If686ad6e20c2906221bc0b8c989ee2d913ad11e2 Gerrit-PatchSet: 7 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits