pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
297 stars 443 forks source link

Can not accept a submission if associated review has any review form attached to it. #7909

Closed touhidurabir closed 2 years ago

touhidurabir commented 2 years ago

Describe the bug At Accept Submission, if the associated review has any review form attached to it , it throws internal exception with 500 error code.

To Reproduce Steps to reproduce the behavior:

  1. Create a Submission.
  2. Assign a reviewer and make sure it has a Review Form associated with it.
  3. Complete the review process.
  4. Try to Accept Submission and that will present a 500 error page .

What application are you using? OJS installation of main branch .

touhidurabir commented 2 years ago

Exception Tracing

Exception originated from PKP\mail\traits\ReviewerComments as defined

if ($reviewFormElements->wasEmpty()) {
     return '';
}

Which delegate the call to PKP\reviewForm\ReviewFormElementDAO in the method getByReviewFormId as defined

...
return new DAOResultFactory($result, $this, '_fromRow');

which delegate to PKP\db\DAOResultFactory at method getCount where as no $sql is passed , so this line get executed as

if ($this->sql === null) {
    throw new \Exception('DAOResultFactory instances cannot be counted unless supplied in constructor (DAO ' . get_class($this->dao) . ')!');
}
touhidurabir commented 2 years ago

@asmecher PRs. once reviewed, I will see if I need to forward the changes to OPS and OMP.

pkp-lib --> pkp/pkp-lib#7909 Can not accept a submission if associated review has any review form attached to it ojs --> pkp/pkp-lib#7909 Submodule Update ##touhidurabir/i7909_fix_main##

asmecher commented 2 years ago

Thanks, @touhidurabir! See this comment: https://github.com/pkp/pkp-lib/pull/7913#discussion_r868192045

touhidurabir commented 2 years ago

@asmecher changes are pushed . please review now .

asmecher commented 2 years ago

Merged -- thanks, @touhidurabir!