Skip to content

Commit

Permalink
Fix error when creating a new Section
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti-Jussi Nygård authored and Antti-Jussi Nygård committed Feb 22, 2024
1 parent 65d6abb commit 0c584d2
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 0c584d2

Please sign in to comment.