Creating child theme for OMP


I’m trying to create child theme for OMP. Already did that for OJS and it’s working fine there, but i have a problem with OMP. Everything is the same as in OJS, but on plugins OMP page i get infinitive loading animation. In the error log i have:

PHP Fatal error: Uncaught Error: Call to a member function getCurrent() on null in /omp/lib/pkp/classes/site/\nStack trace:\n#0 /omp/lib/pkp/classes/controllers/grid/plugins/ VersionDAO->insertVersion(NULL, true)\n#1 /omp/lib/pkp/classes/controllers/grid/ PluginGridHandler->loadCategoryData(Object(Request), ‘themes’, Array)\n#2 /omp/lib/pkp/classes/controllers/grid/ CategoryGridHandler->getGridCategoryDataElements(Object(Request), ‘themes’)\n#3 /omp/lib/pkp/classes/controllers/grid/ CategoryGridHandler->_renderCategoryInternally(Object(Request), Object(PluginCategoryGridRow))\n#4 /omp/lib/pkp/classes/controllers/grid/ CategoryGridHandler->_renderCategoriesInternally(Object(Request))\n#5 /omp/lib/pkp/classes/controllers/grid/ CategoryGrid in /omp/lib/pkp/classes/site/ on line 103

This is what i have in index.php

return new ChildThemePlugin();

and this is


class ChildThemePlugin extends ThemePlugin {

        public function init() {

        function getDisplayName() {
                return 'My Theme';

        function getDescription() {
                return 'Some description...';

Anyone have an idea what could be wrong? Thx.


Hi @orcalator

It’s been a while since I’ve looked at building an OMP plugin, but that line of code is expecting a Version object, and it’s getting null instead. This might be due to the fact that your plugin is present on disk but not actually installed, so there is no version history for it yet. I see similar things when building plugins on disk and then test loading them. It’s unusual to have a plugin on disk but not have it in the database also. Normally the database record is created when you upload the .tar.gz via the plugin grid.

You can install a plugin via:

php lib/pkp/tools/installPluginVersion.php plugins/path/to/plugin/version.xml



I solved it by installing OMP again. All is fine now. Thank you for help.

Thank you for help. I tried it but i get this:

php lib/pkp/tools/installPluginVersion.php ./plugins/themes/child/version.xml

PHP Fatal error:  Uncaught Error: Call to a member function getName() on int in /omp/lib/pkp/tools/installPluginVersion.php:71
Stack trace:
#0 /omp/lib/pkp/tools/installPluginVersion.php(99): InstallPluginVersionTool->execute()
#1 {main}
  thrown in /omp/lib/pkp/tools/installPluginVersion.php on line 71


Unfortunately i have another problem now. Child theme is installed but it seems OMP is still showing up default theme on frontend. I want to change 2 templates and i made the same file structure as in OJS:

/templates/frontend/components/header.tpl (filename here is different then in OJS - headerSite.tpl in OJS)

However, whatever change i make to templates, default OMP template is shown. I tried clearing template cache but it didn’t work. Any ideas? Thx.


Hi @orcalator

My understanding is that the indexSite.tpl template is only loaded outside of a journal context. Is your theme installed at the site level?


Hi @jnugent,

Yes, it is installed on a site level and this works in OJS although my custom child theme is not checked under the “Theme plugins” (also a bit strange). Only theme that is checked is “Default theme”. However in OMP it doesn’t work (checked or unchecked).


Ok, i solved it. I just had to choose “My theme” from “Appearance” menu. All fine now!