[OJS 3.5.0.0 Upgrade] Missing submissionDiscipline Entries in controlled_vocab_entry_settings Table

Hello @everyone,

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:

  1. Has anyone else experienced missing or changed submissionDiscipline controlled vocabulary entries after upgrading to OJS 3.5.0.0?
  2. Are there known changes in how controlled vocabularies or their settings are managed in 3.5.0.0?
  3. Is there a recommended way to migrate or restore these entries properly?
  4. 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 in advance!

Best regards,
Darryl

Upgrade:




Details:

  • Before upgrade:

```` SELECT * FROM controlled_vocab_entry_settings WHERE setting_name =‘submissionDiscipline’;`

  • After upgrade:

```` SELECT * FROM controlled_vocab_entry_settings WHERE setting_name =‘submissionDiscipline’;`

Best regards,
Darryl

Hi , in 3.5.0 we have renamed the setting_name value of controlled_vocab_entry_settings table from different symbolics like submissionKeyword, submissionDiscipline etc to just name as part of Convert controlled vocabulary classes to Eloquent models · Issue #10292 · pkp/pkp-lib · GitHub and later got more enhancement as part of Allow a journal to define a limited set of allowed keywords and reviewer interests · Issue #1550 · pkp/pkp-lib · GitHub . So basically that query SELECT * FROM controlled_vocab_entry_settings WHERE setting_name =‘submissionDiscipline’; will not return any result . Do you see those missing in your submission metadata section from workflow also ? if not , then it is fine .

@touhidur ;

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.

Best Regards,
Darryl

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 .

Hello,

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?

Best Regards,

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');

Hope this help.

Regards
Touhidur Rahman
PKP Dev Team

1 Like

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.


:brain: Step 1: Modify ArticleHandler.php

:file_folder: Path:
pages/article/ArticleHandler.php

:plus: 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;

:downwards_button: 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);

:round_pushpin:Place the code before this line:

$templateMgr->display('frontend/pages/article.tpl');

:puzzle_piece: Step 2: Modify article_details.tpl

:file_folder: Path:
templates/frontend/objects/article_details.tpl

Locate the Abstract section (~line 182):

{* Abstract *}
{if $publication->getLocalizedData('abstract')}
    <section class="item abstract">
        <h2 class="label">{translate key="article.abstract"}</h2>
        <div style="text-align:justify; text-indent:25px;">
            {$publication->getLocalizedData('abstract')|strip_unsafe_html}
        </div>
{/if}

:downwards_button: Add this block after the Abstract section:

{if $disciplines|@count}
    <section class="article-disciplines">
        <h2>{translate key="submission.disciplines"}</h2>
        <ul>
            {foreach from=$disciplines item=discipline}
                <li>{$discipline|escape}</li>
            {/foreach}
        </ul>
    </section>
{/if}

:globe_with_meridians: Step 3: Add the Locale String

:file_folder: Path:
locale/en/locale.po

Append this entry:

msgid "submission.disciplines"
msgstr "Disciplines"

:speech_balloon: Final Notes

  • :white_check_mark: Works in OJS 3.5.0-0
  • :see_no_evil_monkey: If the submission has no discipline set, nothing is shown.
  • :wrench: I’m planning to convert this into a plugin next (stay tuned).
  • :free_button: Feel free to reuse or improve — just credit or reference if you share.

Thanks @touhidur for your guidance — it helped a lot along the way! :raising_hands:

Hope this helps others in the OJS community!



Best Regards,
Darryl