Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Permit correct storage of section ID on initial insert
  • Loading branch information
asmecher committed Sep 13, 2019
1 parent 8d28a18 commit 979337f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions classes/services/SubmissionService.inc.php
Expand Up @@ -172,4 +172,12 @@ public function getInSections($issueId, $contextId) {

return $bySections;
}

/**
* @copydoc \PKP\Services\EntityProperties\EntityWriteInterface::add()
*/
public function add($submission, $request) {
$submission->setData('sectionId', $submission->getSectionId());
return parent::add($submission, $request);
}
}

6 comments on commit 979337f

@asmecher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NateWr, I was ambivalent about doing this through function extension vs. through hooks -- maybe you have a preference?

@NateWr
Copy link
Member

@NateWr NateWr commented on 979337f Sep 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asmecher I'm not sure this is doing anything. The sectionId is now attached to the publication, not the submission, so no sectionId should be saved to the Submission object. I think it will be ignored regardless.

Maybe I'm misunderstanding something though...

@asmecher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed this in practice to get the QuickSubmit plugin working again after the versioning merges -- I didn't look deeply into the role of the section_id in the submissions table, but there's still something there using it. @defstat and @NateWr, should this column be removed in favour of the publications table? If so, I suspect there are some remaining dependencies.

@NateWr
Copy link
Member

@NateWr NateWr commented on 979337f Sep 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you had run the upgrade process? There should be no section_id in the submissions table in the master branch...

@asmecher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, clearly needs more investigation. I'll take another look and make sure I'm fully rebased.

@asmecher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this now appears to be dead code. Maybe I was on an older rebase? I've reverted it.

Please sign in to comment.