Call to a member function getDecision() on null error in OMP 3.5 submission workflow

Hi All,

I’m getting an unexpected error on my published panel. Has anyone else experienced something similar?

OMP 3.5.0.1

Error: Call to a member function getDecision() on null in \lib\pkp\classes\submission\maps\Schema.php:957

Regards,

Hi,

In /lib/pkp/classes/submission/maps/Schema.php:957 Changing this worked for me..

// Retrieve recommendations for the review stage $reviewRecommendations = collect(); if ( isset($currentReviewRound) && isset($decisions) && $decisions->isNotEmpty() ) { foreach ($decisions as $decision) { // Get only recommendation decisions $decisionType = Repo::decision()->getDecisionType($decision->getData(‘decision’)); if (!Repo::decision()->isRecommendation($decisionType->getDecision())) { continue; } // Get only decisions related to the relevant review round if ($currentReviewRound->getId() != $decision->getData(‘reviewRoundId’)) { continue; } $reviewRecommendations->push($decision); } }

por

// Retrieve recommendations for the review stage
$reviewRecommendations = collect();
if (
isset($currentReviewRound) &&
isset($decisions) && $decisions->isNotEmpty()
) {
foreach ($decisions as $decision) {

    // Asegurarse de que $decision no es null
    if ($decision === null) {
        continue;
    }

    // Get only recommendation decisions
    $decisionData = $decision->getData('decision');
    if ($decisionData === null) {
        continue;
    }

    $decisionType = Repo::decision()->getDecisionType($decisionData);

    // Proteger contra getDecision() sobre null
    if ($decisionType === null || !Repo::decision()->isRecommendation($decisionType->getDecision())) {
        continue;
    }

    // Get only decisions related to the relevant review round
    if ($currentReviewRound->getId() != $decision->getData('reviewRoundId')) {
        continue;
    }

    $reviewRecommendations->push($decision);
}
}

Regards,

Hi @desarrollo_escire!

FYI, this workaround isn’t enough to address the problem properly. See related issues in GitHub, I just can say the solution is kind of ready, just waiting to be approved/merged:

Best,
Jonas Raoni