Skip to content

Commit 3270f71

Browse files
committed
PHP 8 compatibility
1 parent f5c520b commit 3270f71

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

RSCIExportPlugin.inc.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ function manage($args, $request) {
8989
return parent::manage($args, $request);
9090
}
9191

92-
private $_context;
93-
9492
/**
9593
* Get the zip with XML for an issue.
9694
* @param $issueId int
@@ -115,7 +113,6 @@ function exportIssue($issueId, $context)
115113
$rsciExportFilters = $filterDao->getObjectsByGroup('issue=>rsci-xml');
116114
assert(count($rsciExportFilters) == 1); // Assert only a single serialization filter
117115
$exportFilter = array_shift($rsciExportFilters);
118-
$context = Application::getRequest()->getContext();
119116
$exportSettings = array ('isExportArtTypeFromSectionAbbrev' => $this->getSetting($context->getId(), 'exportArtTypeFromSectionAbbrev'),
120117
'isExportSections' => $this->getSetting($context->getId(), 'exportSections'),
121118
'journalRSCITitleId' => $this->getSetting($context->getId(), 'journalRSCITitleId'));
@@ -213,7 +210,7 @@ function getExportPath()
213210
if ($this->_generatedTempPath === '')
214211
{
215212
$exportPath = parent::getExportPath();
216-
$journal = Application::getRequest()->getJournal();
213+
$journal = Registry::get('request', false)->getJournal();
217214
$this->_generatedTempPath = $exportPath . $this->getPluginSettingsPrefix() . 'Temp-' . date('Ymd-His'). $journal->getId() . '/';
218215
}
219216
return $this->_generatedTempPath;

classes/form/RSCIExportSettingsForm.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ function readInputData() {
8383
/**
8484
* Execute the form.
8585
*/
86-
function execute() {
86+
function execute(...$functionArgs) {
8787
$plugin = $this->_getPlugin();
8888
$contextId = $this->_getContextId();
8989
foreach($this->getFormFields() as $fieldName => $fieldType) {
9090
$plugin->updateSetting($contextId, $fieldName, $this->getData($fieldName), $fieldType);
9191
}
92+
parent::execute(...$functionArgs);
9293
}
9394

9495

filter/ArticleRSCIXmlFilter.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ protected function _convertLocaleToISO639($locale)
573573

574574
if ($lang3chars == '')
575575
{
576-
$user = Application::getRequest()->getUser();
576+
$user = Registry::get('request', false)->getUser();
577577
$notificationManager = new NotificationManager();
578578
$notificationManager->createTrivialNotification($user->getId(),
579579
NOTIFICATION_TYPE_WARNING,
@@ -606,7 +606,7 @@ protected function _convertISO639ToLocale($lang3chars)
606606
}
607607

608608
// If can't convert ISO639 to UNIX locale:
609-
$user = Application::getRequest()->getUser();
609+
$user = Registry::get('request', false)->getUser();
610610
$notificationManager = new NotificationManager();
611611
$notificationManager->createTrivialNotification($user->getId(),
612612
NOTIFICATION_TYPE_WARNING,
@@ -625,7 +625,7 @@ protected function _convertISO639ToLocale($lang3chars)
625625
*/
626626
protected function _getISO639()
627627
{
628-
if (!is_a($this->_iso, $this))
628+
if (!isset($this->_iso))
629629
{
630630
require_once($_SERVER['DOCUMENT_ROOT'] . '/plugins/importexport/rsciexport/php-iso-639/src/ISO639.php'); // TODO: import without $_SERVER.
631631
$this->_iso = new ISO639();

version.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<version>
1010
<application>rsciexport</application>
1111
<type>plugins.importexport</type>
12-
<release>0.1.1.0</release>
12+
<release>0.1.2.0</release>
1313
<date>2021-11-30</date>
1414
</version>

0 commit comments

Comments
 (0)