sahmad
November 4, 2019, 5:56pm
1
I’m using the following code from to select the IssueID for a publishedArticle object
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$issueDao = DAORegistry::getDAO('issueDAO');
$article = $publishedArticleDao->getById($submissionId);
$issueId = $article->getIssueId();
$issue = $issueDao->getById($issueId);
However, I always get NULL for $issueId, even though the selected submission is published and assigned an issue. I’d appreciate all help on this issue.
ajnyga
November 5, 2019, 9:47am
2
What version of OJS are you using?
ajnyga
November 6, 2019, 11:51am
4
Have you tried: $article = $publishedArticleDao->getByArticleId($submissionId);
sahmad
November 6, 2019, 12:58pm
5
That worked perfectly! Wonder why it didn’t select the IssueId when using $article = $publishedArticleDao->getById($submissionId);
?
That looks like a bug in 3.1.2-1. It appears to be resolved in 3.1.2-2 via Fix incomplete fetch of published_submissions columns (leading to PHP warnings) · Issue #4907 · pkp/pkp-lib · GitHub
Specifically:
committed 02:31PM - 02 Aug 19 UTC
This is substantially refactored in 3.2, and I didn’t fully trace the code there.