All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: On saving structure channels preview would display homepage (site_url)

Status Resolved
Add-on / Version Publisher Lite 1.6.11
Severity
EE Version 2.9.2

Dave O'Brien

Mar 22, 2016

Hi Brian

I was having an issue with previewing structure channels. When saving a structure managed channel entry, the preview would show the home page. These channels had no preview templates assigned to them (naturally) and the structure templates are set correctly. I took look under the hood myself and traced the issue back to:

publisher_template.php - get_preview() returning the site_url to
publisher_draft_preview.php - create_url() [LINE 144]

I would have thought this should have returned FALSE as there isn’t a preview template set for this. It’s not, its returning the row array. I took a look at the publisher_previews table and it all my channels have a row although the majority of them have a blank override’s, templates, appends - should these rows with blank overrides even be in the table?

Anyway, I’ve removed these rows and my structure pages are working OK, and the channels with preview are working as expected.

*I’m cool with it staying like this, but just wanted to flag it to see if its a bug that’s crept in. I am using some custom add ons and the better pages add on so don’t worry about this if you can’t replicate the issue.*

To detail my steps:

- Installed publisher lite (included P&T update)
- Navigated to settings - ignored some channels, and some custom fieldtypes
- Navigated to preview templates - added preview URI’s for the non-structure managed channels
- Tested preview on a non-structure managed channel - works
- Tested preview on a structure managed channel - on save, the preview box displays,  showing the homepage
- Rooted around the code - changed nothing
- Removed the rows relating to the structure managed entries in the publisher_previews
- Retested preview on structure managed and non structure managed channel - works

Cheers

Dave

#1

BoldMinded (Brian)

Hi Dave, thanks for the report. I’ll try to take a look at that soon and see if I can replicate.

#2

BoldMinded (Brian)

Dave, what happens if you change the first conditional to this?

https://www.dropbox.com/s/nhdrbzotfs7one0/Screenshot 2016-03-26 08.25.48.png?dl=0

That way if no template ID is defined it’ll just return and I believe be the behavior you’re expecting?

#3

BoldMinded (Brian)

Dave, just following up on this.

#4

Dave O'Brien

Sorry Brian, I’ll try to grab 10 minutes today to take a look - thank you!

#5

Dave O'Brien

Hi Brian,

That looks like it’s worked a treat. I saved the preview templates first to regenerate null database rows and I’m still previewing the correct template on entry save.

Much appreciated

Dave

Login to reply