njamar
June 29, 2022, 2:07pm
1
Hello everyone,
I’m doing the upgrade for a multi hosting ojs (20 journals). We were on ojs 3.1.2 and we want to upgrade to ojs 3.3.
A journal has, few years ago, developed a plugin. I have to do the upgrade of this plugin.
I have some troubles with this piece of code:
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$articles = $publishedArticleDao->getPublishedArticles($issue->getId());
I have seen that PublishedArticleDAO is no more valid with the OJS 3.3 version. Do you have any suggestion on how I can get the publishedArticle in another manner ? I though I can do it with
$publicationDAO = DAORegistry::getDAO('PublicationDAO');
But I’m not sure if it’s the same and I don’t know how to get the articles. Do you have any suggestions?
Any help is very appreciated.
Noémie
Hi @njamar
I’d recommend looking at the OJS 3.3 page handler code to how submissions are fetched for an issue’s table of contents. For example, beginning here:
return $genre->getId();
}, $primaryGenres);
// Show scheduled submissions if this is a preview
import('classes.submission.Submission'); // import STATUS_ constants
$allowedStatuses = [STATUS_PUBLISHED];
if (!$issue->getPublished()) {
$allowedStatuses[] = STATUS_SCHEDULED;
}
$issueSubmissions = iterator_to_array(Services::get('submission')->getMany([
'contextId' => $journal->getId(),
'issueIds' => [$issue->getId()],
'status' => $allowedStatuses,
'orderBy' => 'seq',
'orderDirection' => 'ASC',
]));
$sections = Application::get()->getSectionDao()->getByIssueId($issue->getId());
$issueSubmissionsInSection = [];
foreach ($sections as $section) {
Best
Jason
njamar
July 26, 2022, 8:09am
3
I succeeded thanks to your very helpful answer.
Thank you very much !
Noémie