Bug #23627 Bug Fixed

preview fails on entries with pages module when pages tab is hidden

Version: 4.3.1 Reporter: bree

When using the pages module, if the pages tab and/or the pages template field is hidden in an edit layout, the preview panel always shows the homepage.
Is it possible to hide the page’s template drop down from the editor and still have a working preview?

  • In system/ee/EllisLab/ExpressionEngine/Model/Channel/ChannelEntry.php add the following at line 1201:

    public function getPageTemplateID()
    {
        if ( ! $this->hasPageURI())
        {
         return NULL;
        }
    
        return $this->Site->site_pages[$this->site_id]['templates'][$this->getId()];
    }

    In system/ee/EllisLab/ExpressionEngine/Controller/Publish/Publish.php at line 408 add:

    if ( ! $template_id)
    {
        $template_id = $entry->getPageTemplateID();
    }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases