OMP monography series title

Hi all,

I just migrated from the OMP 3.1.2.2 to the OMP 3.3.0.13.
In the old version I implemented some changes on the frontend (templates) and would like to do the same also on the latest version.
In the past I used in the template $monograph->getSeriesTitle() to get the name of the series the monograph belongs to. Unfortunately this method/call is not available in the latest version.

Can you please help me what changes are required to get the same functionality also on the latest OMP version? That is the series name of the monograph, used in a frontent template.

Regards, PrimoĹľ

Hello!
For reference I posted the same question here OMP 3.3 Series title in monograph summary and an improvement suggestion here [OMP] Display series title and position in catalog view. But now my brilliant colleague Kevin, from our IT department, managed to solve it.

He added the following to the submission class classes/submission/Submission.inc.php:

    function getSeriesTitle() {
            $publication = $this->getCurrentPublication();
            if (!$publication) {
                    return '';
            }
            $seriesId = $publication->getData('seriesId');
            if (!$seriesId) {
                    return '';
            }
            $seriesDao = DAORegistry::getDAO('SeriesDAO');
            $series = $seriesDao->getById($seriesId, $this->getData('contextId'));
            if (!$series) {
                    return '';
            }
            return $series->getLocalizedTitle();
    }

Apparently it’s a quick solution that may be improved, but it’s working fine for us here https://books.lub.lu.se/.
Maybe this could work for you as well?

Best regards,
Magnus

Hi @mannemark,

Thank you for your help. It did the magic :slight_smile:

Best regards, PrimoĹľ

1 Like

Hi @mannemark
how would that code look like in OMP 3.4 without direct access to the DAO? Have you already tested that? I’d be curious?
best regards
Klaus

Hello @klausru, no that’s not something that we are aware of. I personally don’t know how this code works at all unfortunately, and the upgrade to 3.4 is some time away for us (next year hopefully).

Are you saying this code will not be valid in 3.4?

Best regards,
Magnus

Dear Magnus
I was just interested in your code snippet and in customising OMP. At the same time I realised that v3.4 is now published and brings some changes: https://docs.pkp.sfu.ca/dev/release-notebooks/en/3.4-release-notebook
E.g., where it says “Direct access to the DAO is discouraged”, and other things that should be individually tested before upgrading production sites.
Best
Klaus

OK, then I understand. Thank you for letting me know about this, we will have to have a closer look at all modifications where we use this type of access before upgrading.

Dear @klausru,
I mentioned this to our IT wizard Kevin and he suggested that this might work for the new version:

$series = Repo::section()->get($seriesId, $this->getData('contextId'));

Obviously it needs to be tested.
All the best,
Magnus