Skip to content

Commit

Permalink
pkp/pkp-lib#5688 Fix upgrade from OJS 2.x to 3.x with remote galleys (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher authored Mar 31, 2020
1 parent 6d1e27a commit 0c050ce
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions classes/install/Upgrade.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1073,19 +1073,24 @@ function convertSupplementaryFiles() {
}
$remoteSuppFileSettingsResult->Close();

$articleGalley = $articleGalleyDao->newDataObject();
$articleGalley->setSubmissionId($article->getId());
$articleGalley->setLabel($remoteSuppFileTitle[$article->getLocale()]);
$articleGalley->setRemoteURL($row['remote_url']);
$articleGalley->setLocale($article->getLocale());
$articleGalleyDao->insertObject($articleGalley);
// Converted from DAO call to raw SQL because submission_id is no longer available post-schema sync.
$articleGalleyDao->update(
'INSERT INTO submission_galleys (locale, submission_id, remote_url, label) VALUES (?, ?, ?, ?)',
array(
$article->getLocale(),
$article->getId(),
$row['remote_url'],
$remoteSuppFileTitle[$article->getLocale()],
)
);
$galleyId = $articleGalleyDao->getInsertId();

// Preserve extra settings. (Plugins may not be loaded, so other mechanisms might not work.)
foreach ($extraRemoteGalleySettings as $name => $value) {
$submissionFileDao->update(
'INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) VALUES (?, ?, ?, ?)',
array(
$articleGalley->getId(),
$galleyId,
$name,
$value,
'string'
Expand Down

0 comments on commit 0c050ce

Please sign in to comment.