I recently upgraded my OJS installation from version 3.4.0-8 to 3.5.0.0. After the upgrade, I noticed that the controlled vocabulary entries for submissionDiscipline are missing from the controlled_vocab_entry_settings table.
Details:
Before upgrade:
The submissionDiscipline vocabulary entries were present in the controlled_vocab_entry_settings table with setting_name such as name and localized labels.
After upgrade:
The submissionDiscipline entries seem to be missing or the setting_name values have changed, causing disciplines not to appear in the submission workflow.
Database info:
controlled_vocabs table contains the vocabulary submissionDiscipline with ID 2587.
controlled_vocab_entries linked correctly to this vocabulary.
However, controlled_vocab_entry_settings no longer has the expected entries for these vocabularies.
What I have tried:
Verified database schema changes between versions 3.4.x and 3.5.0.0.
Checked upgrade logs for errors or warnings related to controlled vocabularies.
Compared data before and after upgrade in a test environment.
Questions:
Has anyone else experienced missing or changed submissionDiscipline controlled vocabulary entries after upgrading to OJS 3.5.0.0?
Are there known changes in how controlled vocabularies or their settings are managed in 3.5.0.0?
Is there a recommended way to migrate or restore these entries properly?
Could this be a bug or an incomplete migration step in the upgrade process?
Any guidance, insights, or suggestions for troubleshooting this issue would be greatly appreciated.
Thank you for your reply. I did my best to manually locate the entity I was looking for, which is submissionDiscipline. I found that it is stored in the symbolic entities: controlled_vocabs , controlled_vocab_entries , and controlled_vocab_entry_settings . I then created a query to join these tables.
SELECT
cv.controlled_vocab_id,
cv.symbolic,
cve.controlled_vocab_entry_id,
cve.seq,
cves.locale,
cves.setting_name,
cves.setting_value
FROM
controlled_vocabs cv
JOIN
controlled_vocab_entries cve ON cve.controlled_vocab_id = cv.controlled_vocab_id
JOIN
controlled_vocab_entry_settings cves ON cves.controlled_vocab_entry_id = cve.controlled_vocab_entry_id
WHERE
cv.symbolic = 'submissionDiscipline'
AND cves.locale = 'en'
AND cves.setting_name = 'name'
ORDER BY
cve.seq;
Right now, I am looking for the submission_id or publication_id that links to the query above. My purpose is to display the submissionDiscipline on the article page, so that whenever an article is viewed, the metadata discipline assigned to it will also be shown on the article page.
Hi , as you can see the Disciplines metadata in the workflow section, it’s all ok and nothing replaced or removed from database . However not all metadata are considered to be visible in the article landing page through the default theme . perhaps a custom theme or may be via custom plugin using the hook ArticleHandler::view . Please see the guide at https://docs.pkp.sfu.ca/dev/plugin-guide/en/getting-started on how to develop custom theme or plugin .
However, I am not looking to create a plugin or custom theme. My goal is to directly call the Disciplines metadata within my query code. What I need help with is understanding which OJS table links the submission_id or publication_id to the vocabs table, so I can match the discipline metadata with the article’s title and abstract. Also, how do I verify that the discipline shown on the article landing page is the same as the one associated with the article itself?
Hi, the mapping in the DB as controlled_vocab_entrie_settings are mapped to controlled_vocab_entries which then mapped with controlled_vocabs where assoc_type define a type like publication (see Application::ASSOC_TYPE_PUBLICATION) and assoc_id mapped to like publication_id of publications table and again where publications are mapped with submissions table . You need to build the raw sql that way .
However if you are working with a PHP end , then you can use the entity models ControlledVocabEntry and ControlledVocab as
ControlledVocabEntry::whereHas("ControlledVocab", function ($query) {
$query
->where(
"symbolic",
ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_DISCIPLINE
)
->where("assoc_type", Application::ASSOC_TYPE_PUBLICATION)
->where("assoc_id", SOME_PUBLICATION_ID); // replace with publication_id
})->get();
// Alternative approach
$publication = Repo::publication()->get(SOME_PUBLICATION_ID);
// or get the current publication from submission
$publication = Repo::submission()->get(SUBMISSION_DI)->getCurrentPublication();
$publication->getData('disciplines');
After some effort, testing, and research, I successfully retrieved and displayed the “Disciplines” metadata on the article view page in OJS 3.5.0-0.
This guide is for anyone who wants to display submission disciplines on the article page (frontend). If no discipline is entered, the section is not shown.
Step 1: Modify ArticleHandler.php
Path: pages/article/ArticleHandler.php
Add use statements at the top:
use PKP\controlledVocab\ControlledVocab;
use PKP\controlledVocab\ControlledVocabEntryMatch;
use Illuminate\Support\Facades\DB;
use PKP\submission\Repo as SubmissionRepo;
Insert the following code after this line (~line 372):
if (!Hook::call('ArticleHandler::view', [&$request, &$issue, &$article, $publication])) {
// Fetch and assign discipline names
$results = DB::select("
SELECT cves.setting_value AS discipline_name
FROM publications p
JOIN controlled_vocabs cv ON cv.assoc_type = ? AND cv.assoc_id = p.publication_id AND cv.symbolic = ?
JOIN controlled_vocab_entries cve ON cve.controlled_vocab_id = cv.controlled_vocab_id
JOIN controlled_vocab_entry_settings cves ON cves.controlled_vocab_entry_id = cve.controlled_vocab_entry_id
AND cves.setting_name = 'name'
AND cves.locale = ?
WHERE p.publication_id = ?
", [
\APP\core\Application::ASSOC_TYPE_PUBLICATION,
'submissionDiscipline',
$context->getPrimaryLocale(),
$publication->getId()
]);
$disciplineNames = array_map(fn($row) => $row->discipline_name, $results);
$templateMgr->assign('disciplines', $disciplineNames);