From 530272b413faf3e03109a252ae98c434087c89f2 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Thu, 26 Jul 2018 13:01:20 -0700 Subject: [PATCH 1/2] Avoid moving things around --- Template.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Template.php b/Template.php index 387b852a65..4703e5e37e 100644 --- a/Template.php +++ b/Template.php @@ -107,14 +107,16 @@ public function process() { $this->use_unnamed_params(); $this->expand_by_arxiv(); - $saved_date = $this->get('date');// Forget dates so that DOI can update with publication date, not ARXIV date - $saved_year = $this->get('year'); - $this->forget('date'); - $this->forget('year'); + // Forget dates so that DOI can update with publication date, not ARXIV date + $this->rename('date', 'CITATION_BOT_date'); + $this->rename('year', 'CITATION_BOT_year'); $this->expand_by_doi(); if ($this->blank('year') && $this->blank('date')) { - if ($saved_date) $this->add('date', $saved_date); - if ($saved_year) $this->add('year', $saved_year); + $this->rename('CITATION_BOT_date', 'date'); + $this->rename('CITATION_BOT_year', 'date'); + } else { + $this->forget('CITATION_BOT_year'); + $this->forget('CITATION_BOT_date'); } $this->tidy(); From 5513fa02158bb296183d2e0c76b0ceecaec88b0e Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Thu, 26 Jul 2018 13:07:15 -0700 Subject: [PATCH 2/2] Typo phone writing code on a phone --- Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Template.php b/Template.php index 4703e5e37e..b71db8997f 100644 --- a/Template.php +++ b/Template.php @@ -113,7 +113,7 @@ public function process() { $this->expand_by_doi(); if ($this->blank('year') && $this->blank('date')) { $this->rename('CITATION_BOT_date', 'date'); - $this->rename('CITATION_BOT_year', 'date'); + $this->rename('CITATION_BOT_year', 'year'); } else { $this->forget('CITATION_BOT_year'); $this->forget('CITATION_BOT_date');