OMP: Strange theme behavior after upgrade to


After OMP upgrading to, found a strange behavior of custom developed theme: in previous used OMP version,, variables declared in theme functions was passed to frontend and backend custom templates, but in upgraded - to the frontend only.

* Initialize the theme’s styles, scripts and hooks. This is run on the
* currently active theme and it’s parent themes.
* @return null
public function init() {
HookRegistry::register (‘TemplateManager::display’, array($this, ‘loadTemplateData’));
$this->addScript(‘defoverfrontend’, ‘js/frontend.js’, array(‘contexts’ => ‘frontend’));
$this->addScript(‘defoverbackend’, ‘js/backend.js’, array(‘contexts’ => ‘backend’));
$this->addStyle(‘defoverfrontend’, ‘styles/defover.css’, array(‘contexts’ => ‘frontend’));

    	public function loadTemplateData($hookName, $args) {
        // Retrieve the TemplateManager
        $templateMgr = $args[0];
    	$departments = $this->getDepartmentsOptionsList();
        $templateMgr->assign('departments', $departments);

And, like I said earlier, variable $departments is passed only to the frontend template - plugins/themes/defover/templates/frontend/components/registrationForm.tpl, but not to the plugins/themes/defover/templates/common/userDetails.tpl and plugins/themes/defover/templates/user/contactForm.tpl

Maybe there is some changes (bugs?) of theming in release?


1 Like