From 6db171122e2277a3188223024abe8c5a78bb3b45 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Fri, 23 Oct 2020 07:25:45 -0500 Subject: [PATCH 1/5] Category:CS1 maint: MR format --- category.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/category.php b/category.php index 06726a8ea7..75b6ce3bba 100644 --- a/category.php +++ b/category.php @@ -13,7 +13,7 @@ $category = trim($category); if ($category === '' && isset($_GET["cat"])) { $maybe = (string) $_GET["cat"]; - if (in_array($maybe, ['CS1 errors: DOI' , 'CS1 maint: PMC format'])) $category = $maybe; + if (in_array($maybe, ['CS1 errors: DOI' , 'CS1 maint: PMC format', 'CS1 maint: MR format'])) $category = $maybe; } if (strtolower(substr($category, 0, 9)) == 'category:') $category = trim(substr($category, 9)); From c1a87a1082413943cf6d36132f2d5dca9f0baa1d Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Fri, 23 Oct 2020 07:26:58 -0500 Subject: [PATCH 2/5] Update Template.php --- Template.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Template.php b/Template.php index 9aa99ed683..282c540d98 100644 --- a/Template.php +++ b/Template.php @@ -4295,6 +4295,12 @@ public function tidy_parameter(string $param) : void { } } return; + + case 'mr': + if (preg_match("~mr(\d+)$~i", $this->get($param), $matches)) { + $this->set($param, $matches[1]); + } + return; case 'others': case 'day': case 'month': // Bad idea to have in general if ($this->blank($param)) $this->forget($param); From 80e2b3554cb391ab38b8c643948dd895aa803627 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Fri, 23 Oct 2020 10:10:42 -0500 Subject: [PATCH 3/5] Update testBaseClass.php --- tests/testBaseClass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testBaseClass.php b/tests/testBaseClass.php index 7daf84e42f..a8d71424d3 100644 --- a/tests/testBaseClass.php +++ b/tests/testBaseClass.php @@ -6,10 +6,10 @@ abstract class testBaseClass extends PHPUnit\Framework\TestCase { // Change these to temporarily disable sets of tests====================== private $testing_skip_zotero = TRUE; // TODO - broken - private $testing_skip_bibcode= TRUE; // TODO - save searches + private $testing_skip_bibcode= FALSE; // private $testing_skip_google = FALSE; // private $testing_skip_wiki = FALSE; // - private $testing_skip_dx = TRUE; // TODO - down partially + private $testing_skip_dx = FALSE; // private $testing_skip_arxiv = FALSE; // // ======================================================================= From c18d625c89bfb2022245c0ea02f3bee5e5da3802 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Fri, 23 Oct 2020 13:27:43 -0500 Subject: [PATCH 4/5] Update apiFunctionsTest.php --- tests/phpunit/apiFunctionsTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/apiFunctionsTest.php b/tests/phpunit/apiFunctionsTest.php index 1832df38fc..4cc7041906 100644 --- a/tests/phpunit/apiFunctionsTest.php +++ b/tests/phpunit/apiFunctionsTest.php @@ -241,8 +241,12 @@ public function testExpansion_doi_not_from_crossref_europa_monograph() : void { $this->requires_dx(function() : void { $expanded = $this->make_citation('{{Cite journal}}'); expand_doi_with_dx($expanded, '10.2788/14231'); - $this->assertSame('{{Cite journal|year = 2007|last1 = Vogt|first1 = Jürgen|last2 = Foisneau|first2 = Stéphanie|title = European river and catchment database, version 2.0 (CCM2) : Analysis tools|publisher = Publications Office}}', $expanded->parsed_text()); - }); + if ($expanded->has('author1')) { + $this->assertSame('{{Cite journal|year = 2007|author1 = European Commission. Joint Research Centre. Institute for Environment Sustainability|last2 = Vogt|first2 = Jürgen|last3 = Foisneau|first3 = Stéphanie|title = European river and catchment database, version 2.0 (CCM2) : Analysis tools|publisher = Publications Office}}', $expanded->parsed_text()); + } else { + $this->assertSame('{{Cite journal|year = 2007|last1 = Vogt|first1 = Jürgen|last2 = Foisneau|first2 = Stéphanie|title = European river and catchment database, version 2.0 (CCM2) : Analysis tools|publisher = Publications Office}}', $expanded->parsed_text()); + } + }); } public function testComplexCrossRef() : void { From d81ed0ffc911dfda32daca8e8e1d316308aa2e70 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Fri, 23 Oct 2020 16:43:07 -0500 Subject: [PATCH 5/5] Update Template.php --- Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Template.php b/Template.php index 282c540d98..d44a884347 100644 --- a/Template.php +++ b/Template.php @@ -847,7 +847,7 @@ public function add_if_new(string $param_name, string $value, string $api = '') } return FALSE; - case 'chapter': case 'contribution': + case 'chapter': case 'contribution': case 'article': case 'section': // We do not add article/section, but sometimes found floating in a template if (!$this->blank(['booktitle', 'book-title']) && $this->has('title')) return FALSE; if ($this->blank(CHAPTER_ALIASES)) { return $this->add($param_name, wikify_external_text($value));