Upgrading OJS 3.5.0.4 to 3.5.0.5

XIAO Qinghe
XIAO Qinghe
Administrator
1817
Article
0
Fans
DiaryComments75Characters 2080Views6min56sRead

1. Download the latest version of the source files from the official website: https://pkp.sfu.ca/software/ojs/download/

2. Create a test site (including a database and folders), upload the latest version of the source files to the test site, and configure SSL and the database (config.inc)

3. Copy the old folders `files` and `public` to the test directory

4. It is recommended to delete the old plugins, as they are incompatible (e.g., `plugins/generic/citationStyleLanguage/`)

5. Upgrade via the terminal:

cd /www/wwwroot/folder
sudo -u www php tools/upgrade.php upgrade

6. Modify `config.inc`

Change `install=on` to `off`

7. Modify `config.inic`

`display_errors = On`
`show_stacktrace = On`

Using Gemini, you can identify and fix errors (e.g., `api_key = “”`—you’ll need to add a 32-character API key)

After the upgrade is successful, make the following changes:

1. Go to the admin panel, set the page template to “default,” and then reinstall the template

2. Remove `index.php` from the URL

Set `restful_urls = On`

Configure URL rewriting

# Ignore actual files, directories, and symbolic links; rewrite all other requests to `index.php`
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php$1 last;
}
}

Old code:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

3. Disable error display:

display_errors = Off
show_stacktrace = Off

4. Modify the logo

templates/images

5. Many plugins are missing; download and upload them from the website:
https://pkp.github.io/plugin-compatibility/index.html

Note: After uploading the plugins, the previous settings will still be preserved.

6. Modify Chinese-language pages: “期25” becomes “No. 25”; “参考” becomes “References”; “downloads” becomes “Downloads”

Path: /locale/zh_Hans/locale.po

msgid "issue.number"
msgstr "No."

msgid "issue.no"
msgstr "No."

msgid "article.Counts"
msgstr "统计"

msgid "article.Views"
msgstr "浏览"

msgid "article.Downloads"
msgstr "下载"

msgid "article.Downloaded"
msgstr "下载"

msgid "plugins.themes.healthSciences.displayStats.downloads"
msgstr "下载"

msgid "plugins.themes.classic.displayStats.downloads"
msgstr "下载"

msgid "submission.supportingAgencies"
msgstr "基金项目与致谢"

msgid "submission.citations"
msgstr "参考文献"

7. Add a DOI link

Path: plugins/themes/your-theme-name/templates/frontend/objects/article_summary.tpl

Above {call_hook name="Templates::Issue::Issue::Article"}
</div>, add the following code:

{* OJS 3.5 目录页专用:获取当前文章的已激活 DOI 字符串 *}
{assign var=publication value=$article->getCurrentPublication()}
{if $publication && $publication->getData('doiObject')}
{assign var=doiObject value=$publication->getData('doiObject')}
{assign var=doiResolvingUrl value=$doiObject->getResolvingUrl()}
{if $doiResolvingUrl}
<div class="article-summary-doi" style="margin-top: 5px; font-size: 0.9em;">
<span class="label"><strong>DOI:</strong></span>
<a href="{$doiResolvingUrl|escape}" target="_blank">{$doiResolvingUrl|escape}</a>
</div>
{/if}
{/if}

8. Justify text on article pages (requires clearing the browser cache or theme cache)

Path: plugins/themes/classic/less/typography.less

p, li, a, blockquote

Add the following code:

text-align: justify;

9. Partial localization

Path: /locale/zh_Hans/locale.po

msgid “about.onlineSubmissions.submitToSection”
msgstr “Submit to the <a href=\”{$url}\“> {$name} </a> section.”

Change {$name} to: {$name}

This ensures the submission page displays the section information completely.

msgid “about.submissions”
msgstr “Submissions”

Change to: Submissions

This ensures the section is displayed as “Submissions” instead of “Manuscripts.”

11. Add plugins: You can copy the old “plugin” folder again

12. Copy the favicon and other web files, and modify the default files

13. Modify the old website: Set the website directory to the test site folder

14. Delete the test site (do not delete the database or files)

15. Change the domain name

16. Modify email settings

[email]

; Default method to send emails
; Available options: sendmail, smtp, log, phpmailer
default = smtp

; Path to the sendmail, -bs argument is for using SMTP protocol
sendmail_path = "/usr/sbin/sendmail -bs"

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = smtp.zeptomail.com.cn
smtp_port = 465

; Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
; smtp_auth = ssl
smtp_username = ????
smtp_password = ?????

; Enable suppressing SSL/TLS peer verification by SMTP transports
; Note: this is not recommended for security reasons
; smtp_suppress_cert_check = On

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
default_envelope_sender = noreply@ccspub.cc

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide no-reply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = Off

; Force a DMARC compliant from header (RFC5322.From)
; If any of your users have email addresses in domains not under your control
; you may need to set this to be compliant with DMARC policies published by
; those 3rd party domains.
; Setting this will move the users address into the reply-to field and the
; from field wil be rewritten with the default_envelope_sender.
; To use this you must set force_default_enveloper_sender = On and
; default_envelope_sender must be set to a valid address in a domain you own.
; force_dmarc_compliant_from = Off

; The display name to use with a DMARC compliant from header
; By default the DMARC compliant from will have an empty name but this can
; be changed by adding a text here.
; You can use '%n' to insert the users name from the original from header
; and '%s' to insert the localized sitename.
; dmarc_compliant_from_displayname = '%n via %s'

; If enabled, email addresses must be validated before login is possible.
require_validation = Off

; The number of days a user has to validate their account before their access key expires.
validation_timeout = 14

17. The “files” path must be correct (enclosed in double quotes): files_dir = “/www/wwwroot/test.ccspub.cn/files”

18. OJS 3.5 has changed the rules, so it no longer displays page views and download counts as it did in version 3.4. This can be achieved using a plugin:

viewcounter: https://github.com/OJSBR

However, this plugin includes template files that cause layout errors on the page. You can replace them as follows:

Path: plugins/generic/viewcounter/templates/frontend/objects/article_summary.tpl

{**
 * templates/frontend/objects/article_summary.tpl
 * 双主题精确匹配版:
 * 1. Health Sciences (JRCC): 使用 healthSciences 官方原生 structure
 * 2. Classic (JSRH): 100% 使用您提供的原生 article_summary structure
 *}
{assign var="publication" value=$article->getCurrentPublication()}
{* 精确判定当前期刊类型:jrcc 走 Health Sciences,其他(如 jsrh) 走 Classic *}
{assign var="isHealthSciences" value=false}
{if ($currentContext && $currentContext->getPath() == 'jrcc') || $journalPath == 'jrcc'}
{assign var="isHealthSciences" value=true}
{/if}
{if $isHealthSciences}
{* ========================================================= *}
{* 1. Health Sciences 原生结构 (适用于 JRCC 刊)                *}
{* ========================================================= *}
{assign var="articlePath" value=$article->getBestId()}
{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
<div class="article-summary" style="margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #eee;">
{assign var="submissionPages" value=$publication->getData('pages')}
{assign var="submissionDatePublished" value=$publication->getData('datePublished')}
{if $showAuthor && $submissionPages}
<div class="row">
<div class="col">
<div class="article-summary-authors">{$publication->getAuthorString($authorUserGroups)|escape}</div>
</div>
<div class="col-3 col-md-2 col-lg-2">
<div class="article-summary-pages text-right">
{$submissionPages|escape}
</div>
</div>
</div>
{elseif $showAuthor}
<div class="article-summary-authors">{$publication->getAuthorString($authorUserGroups)|escape}</div>
{elseif $submissionPages}
<div class="article-summary-pages text-right">
{$submissionPages|escape}
</div>
{/if}
<div class="article-summary-title" style="margin-top: 0.5rem; margin-bottom: 0.5rem; font-size: 1.1rem; line-height: 1.4; font-weight: 600;">
<a {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
{$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html}
</a>
</div>
{if $showDatePublished && $submissionDatePublished}
<div class="article-summary-date" style="color: #666; font-size: 0.85rem; margin-bottom: 0.5rem;">
{$submissionDatePublished|date_format:$dateFormatLong}
</div>
{/if}
{* OJS 3.5 DOI 展示 *}
{if $publication && $publication->getData('doiObject')}
{assign var=doiObject value=$publication->getData('doiObject')}
{assign var=doiResolvingUrl value=$doiObject->getResolvingUrl()}
{if $doiResolvingUrl}
<div class="article-summary-doi" style="margin-top: 5px; font-size: 0.9em;">
<span class="label"><strong>DOI:</strong></span>
<a href="{$doiResolvingUrl|escape}" target="_blank">{$doiResolvingUrl|escape}</a>
</div>
{/if}
{/if}
{assign var="galleys" value=$article->getGalleys()}
{if !$hideGalleys && $galleys}
<div class="article-summary-galleys" style="margin-top: 0.5rem;">
{foreach from=$galleys item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
{assign var="hasArticleAccess" value=$hasAccess}
{if $currentContext->getSetting('publishingMode') == \APP\journal\Journal::PUBLISHING_MODE_OPEN || $publication->getData('accessStatus') == \APP\submission\Submission::ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication hasAccess=$hasArticleAccess}
{/foreach}
</div>
{/if}
{* viewcounter Stats *}
<div class="viewcounter-wrapper" style="margin-top: 8px;">
{viewcounterStats submission=$article fontSize="13px"}
</div>
{call_hook name="Templates::Issue::Issue::Article"}
</div>
{else}
{* ========================================================= *}
{* 2. Classic 原生结构 (100% 使用您给出的结构,适用 JSRH 刊)   *}
{* ========================================================= *}
{assign var="articlePath" value=$article->getBestId()}
{assign var="publication" value=$article->getCurrentPublication()}
{if $headingLevel}
{assign var="heading" value="h{$headingLevel}"}
{else}
{assign var="heading" value="div"}
{/if}
{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
<article class="article_summary">
<div class="article_summary_body">
<{$heading} class="summary_title_wrapper">
<a class="summary_title" {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
{$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html}
</a>
</{$heading}>
{assign var=submissionPages value=$publication->getData('pages')}
{assign var=submissionDatePublished value=$publication->getData('datePublished')}
{if $showAuthor || $submissionPages || ($submissionDatePublished && $showDatePublished)}
<div class="summary_meta">
{if $showAuthor}
<div class="authors">
{$publication->getAuthorString($authorUserGroups)|escape}
</div>
{/if}
{* Page numbers for this article *}
{if $submissionPages}
<div class="pages">
{$submissionPages}
</div>
{/if}
{if $showDatePublished && $submissionDatePublished}
<div class="published">
{$submissionDatePublished|date_format:$dateFormatShort}
</div>
{/if}
</div>
{/if}
</div>
{if !$hideGalleys}
<div class="galleys_links">
{foreach from=$publication->getData('galleys') item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
{assign var="hasArticleAccess" value=$hasAccess}
{if $currentContext->getSetting('publishingMode') == \APP\journal\Journal::PUBLISHING_MODE_OPEN || $publication->getData('accessStatus') == \APP\submission\Submission::ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication hasAccess=$hasArticleAccess purchaseFee=$currentJournal->getData('purchaseArticleFee') purchaseCurrency=$currentJournal->getData('currency')}
{/foreach}
</div>
{/if}
{* OJS 3.5 目录页专用:获取当前文章的已激活 DOI 字符串 *}
{assign var=publication value=$article->getCurrentPublication()}
{if $publication && $publication->getData('doiObject')}
{assign var=doiObject value=$publication->getData('doiObject')}
{assign var=doiResolvingUrl value=$doiObject->getResolvingUrl()}
{if $doiResolvingUrl}
<div class="article-summary-doi" style="margin-top: 5px; font-size: 0.9em;">
<span class="label"><strong>DOI:</strong></span>
<a href="{$doiResolvingUrl|escape}" target="_blank">{$doiResolvingUrl|escape}</a>
</div>
{/if}
{/if}
{* viewcounter: contadores discretos (visualizações | downloads) *}
<div class="viewcounter-wrapper" style="margin-top: 8px;">
{viewcounterStats submission=$article fontSize="13px"}
</div>
{call_hook name="Templates::Issue::Issue::Article"}
</article>
{/if}
19. OJS 3.5 requires ORCID authorization, which can be implemented via a plugin that allows manual entry.
Plugin: https://github.com/OJSBR
You’ll need to disable the ORCID authorization setting in the “User” settings, after which you can manually enter the ORCID link.

Continue
 
匿名

Comment

Anonymous
Decide

Slide puzzle verification.