The live preview button is no longer displaying in the publish page.
Also, and this may be unrelated, but I tried creating a new entry in the same channel and got a list of errors:
Notice Undefined variable: site_id ee/EllisLab/Addons/pages/tab.pages.php, line 316
Severity: E_NOTICE Warning Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:111) ee/legacy/core/Input.php, line 233
Severity: E_WARNING Warning Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:111) ee/legacy/core/Input.php, line 233
Severity: E_WARNING Warning Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:111) ee/legacy/libraries/Functions.php, line 392
Severity: E_WARNING
This was an update from -dp2 and not a fresh install. If that helps.
For the Live Preview button in system/ee/EllisLab/ExpressionEngine/Controller/Publish/AbstractPublish.php
replace the getPublishFormButtons
function starting at line 427 with:
protected function getPublishFormButtons(ChannelEntry $entry)
{
$buttons = [
[
'name' => 'submit',
'type' => 'submit',
'value' => 'save',
'text' => 'save',
'working' => 'btn_saving'
],
[
'name' => 'submit',
'type' => 'submit',
'value' => 'save_and_new',
'text' => 'save_and_new',
'working' => 'btn_saving'
],
[
'name' => 'submit',
'type' => 'submit',
'value' => 'save_and_close',
'text' => 'save_and_close',
'working' => 'btn_saving'
]
];
// get rid of Save & New button if we've reached the max entries for this channel
if ($entry->Channel->max_entries != 0 && $entry->Channel->total_records >= $entry->Channel->max_entries)
{
unset($buttons[1]);
}
$has_preview_button = FALSE;
$show_preview_button = FALSE;
if ($entry->hasLivePreview())
{
$has_preview_button = TRUE;
$show_preview_button = TRUE;
}
$pages_module = ee('Addon')->get('pages');
if ($pages_module && $pages_module->isInstalled())
{
$has_preview_button = TRUE;
if ($entry->hasPageURI())
{
$show_preview_button = TRUE;
}
}
if ($has_preview_button)
{
$extra_class = ($show_preview_button) ? '' : ' hidden';
$buttons[] = [
'name' => 'submit',
'type' => 'submit',
'value' => 'preview',
'text' => 'preview',
'class' => 'action js-modal-link--side' . $extra_class,
'attrs' => 'rel=live-preview',
'working' => 'btn_previewing'
];
}
return $buttons;
}
In system/ee/EllisLab/Addons/pages/tab.pages.php
at line 311 add
$site_id = ee()->config->item('site_id');
OK, preview button now showing. Using it though, I get these notices in the preview space/window above the page:
Notice Trying to get property of non-object ee/EllisLab/ExpressionEngine/Controller/Publish/Publish.php, line 392
Severity: E_NOTICE Notice Trying to get property of non-object ee/EllisLab/ExpressionEngine/Controller/Publish/Publish.php, line 392
Severity: E_NOTICE Notice Trying to get property of non-object ee/EllisLab/ExpressionEngine/Controller/Publish/Publish.php, line 393
Severity: E_NOTICE Warning Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:111) ee/EllisLab/ExpressionEngine/Boot/boot.common.php, line 487
Severity: E_WARNING
I have debugging turned on, and there’s nothing showing at the actual page URL, only when in preview.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.