Skip to content

Commit

Permalink
Merge pull request #11 from ajnyga/master
Browse files Browse the repository at this point in the history
Fix error when creating a new Section
  • Loading branch information
ajnyga authored Feb 22, 2024
2 parents 65d6abb + 0c584d2 commit ef62623
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions OpenAIREPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ public function initDataSectionFormFields($hookName, $args) {
$request = Application::get()->getRequest();
$context = $request->getContext();
$contextId = $context ? $context->getId() : CONTEXT_ID_NONE;
$section = Repo::section()->get($sectionForm->getSectionId());
if ($section) $sectionForm->setData('resourceType', $section->getData('resourceType'));
if ($sectionForm->getSectionId()) {
$section = Repo::section()->get($sectionForm->getSectionId());
if ($section) $sectionForm->setData('resourceType', $section->getData('resourceType'));
}
}

/**
Expand Down

0 comments on commit ef62623

Please sign in to comment.