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: Publisher Preview Rendering 404

Status Resolved
Add-on / Version Publisher Lite 2.4.1
Severity
EE Version 3.5.7

derek allard

Jun 14, 2017

Description: I having an issue previewing a draft in publisher, the URL to preview the draft is rendering a 404 page since it’s missing a /content in the URL.

http://www.foo.com instead of http://www.foo.com/content

This is essentially the opposite of the issue we were trying to solve yesterday. I am working on getting the most recent version of the software installed and I understand that I should have that.

Detailed steps to reproduce the issue:
1. Login to backend
2. Click on Edit
3. Click on Blog
4. Click on the first Entry: Missed Our Broadcast with the SBA and Box? Re-watch “Kill Your Paperwork & Save Time” Now!
5. Click on View Draft
6. Click on Save as Draft
7. Click “Save & Preview” at the bottom.
8. Preview in iFrame renders 404

As always, I appreciate your time in helping us solve this. Thanks!

 

 

 

 

#1

BoldMinded (Brian)

Can you provide some more information. What does the entries tag look like in that page? Did you use {publisher:entry_status}? http://docs.boldminded.com/publisher/template-tags

What URL is the iframe attempting to load?

#2

derek allard

Hi Brian,

Here is the URL the iframe preview is trying to load: https://beta.gocanvas.com/blog/missed-our-broadcast-with-the-sba-and-box-re-watch-kill-your-paperwork-save?publisher_status=draft&publisher_key=4oHWd3BZ

Here is the entry tag for the page:

{exp:channel:entries channel="blog" limit="1" disable="pagination|trackbacks" track_views="one" require_entry="yes"}

{publisher:entry_status} is not in the tag.

Thanks

#3

BoldMinded (Brian)

Well, first thing is ti add status=”{publisher:entry_status}” to the tag, and then maybe try removing the require_entry parameter. See if that changes anything.

#4

derek allard

Hi Brian,

My entries tag now looks like:

{exp:channel:entries channel=”blog” limit=”1” disable=”pagination|trackbacks” track_views=”one” status=”{publisher:entry_status}”}

You’ll have to apologize for my unfamiliarity with the add-on, but is there a recommended way to trigger an entry preview?

Thanks!

#5

BoldMinded (Brian)

Adding ?publisher_status=draft to the url should show the preview outside of the CP. The same thing happens when it is trying to show a preview in the iframe.

http://docs.boldminded.com/publisher/drafts-workflow

#6

derek allard

Thanks Brian,

So in theory, this URL should show a “draft” of that post:

https://beta.gocanvas.com/content/blog/missed-our-broadcast-with-the-sba-and-box-re-watch-kill-your-paperwork-save?publisher_status=draft

Right now it shows this:

This page contains the following errors:

error on line 6 at column 16: Extra content at the end of the document Below is a rendering of the page up to the first error.

#7

BoldMinded (Brian)

I can’t see that page, it’s white. No errors. Can you paste the whole stack trace here please.

#8

derek allard

I’m getting 2 different errors on that URL … one if I’m logged in and a different one if logged out.

Logged in: https://www.dropbox.com/s/w5051vbx1lom5j8/Screen Shot 2017-06-15 at 8.40.17 AM.png?dl=0 Logged out: https://www.dropbox.com/s/i3kg8p5f2f3f38j/Screen Shot 2017-06-15 at 8.45.37 AM.png?dl=0

Here is the trace from the logged in page: https://www.dropbox.com/s/wucan7f17ecb6xc/Screen Shot 2017-06-15 at 8.44.29 AM.png?dl=0

(tried to paste in as text but went over character limit for comments) … can send via email if needed.

#9

BoldMinded (Brian)

Those are xml and javascript errors, not php code errors from Publisher. This seems more like a templating/javascript issue than an add-on issue.

#10

derek allard

Is the “This page contains the following errors:” not generated by publisher? Want to confirm as my hypothesis was that it was … if it’s xml / js related will have to dig in there. The code in the templates on this site are a mess.

#11

BoldMinded (Brian)

That is 100% an XML error 😊

#12

derek allard

Perfect. Thanks for clarifying. Let me see where I can get to on this side.

#13

derek allard

Hi Brian … Spent time debugging this … what I found was that the preview is loading the wrong URL. For example the preview window loads:

https://beta.gocanvas.com/content/blog/home-builders-heaven-how-streamlining-inspections-increased-sales-by-1m?publisher_status=draft&publisher_key=E2bwhrCI

Which throws errors because the url for the preview should be:

https://beta.gocanvas.com/content/blog/post/home-builders-heaven-how-streamlining-inspections-increased-sales-by-1m?publisher_status=draft&publisher_key=E2bwhrCI

This works fine. So in the settings for publisher I set the Blog to use the blog/post + url_title, which should do the trick (at least in my mind) but it still loads the first url … and that has errors I suspect because there is no template associated with it.

I was reading through the documentation but didn’t see much about the preview templates panel … can you elaborate on this and let me know if I’m thinking of this the right way? On this site some entries are managed by Structure (which should just do the smart thing with publisher) but others (like the blog here are not).

Thanks in advance.

#14

BoldMinded (Brian)

What you described is the correct intended behavior. Put {exp:publisher:pages_debug} into a template and verify that blog entry is not in the pages list. Something is telling it to load it without “post” in the URL.

#15

BoldMinded (Brian)

It might be :debug_pages, I forget which off hand.

#16

BoldMinded (Brian)

I logged into your CP and took a look around.

You have your blog channel defined as a Listing, but don’t have a template assigned to it. I think if you want to actually have “blog/post” in your url, it should not be managed by Structure. If you want to manage it with Structure then you need to assign a template to it, then it uses the blog/post template, but does not put “post” in the url, it just shows the entry at “blog/foo”, which is what is happening now, but uses the blog/post template.

I’m about 99.9% sure this is a configuration issue using Structure, not a Publisher bug.

#17

BoldMinded (Brian)

If the channel is defined as a Page or Listing in Structure, you don’t need to modify Publisher’s Template Previews settings for that channel, Structure handles everything (but you still need the {publisher:entry_status} variable in your status parameter).

#18

derek allard

Thanks for the information here … Yes, this makes sense … I’m not sure why the client has Structure setup this way. From working on this this morning it seems the options are to remove the blog from Structure entirely (but then the client doesn’t have an easy way to manage this from the Structure panel going forward) or to rewrite the template to not include blog in the URL (which has negative SEO consequences).

As for the {publisher:entry_status} variable … does this need to be added to every template on the site? I’m a bit unclear of the purpose of this variable after reading the docs. This site (which to be clear I interited) has well over a hundred templates and they’re all only editable through the EE CP so modifying them would be a significant work around. Before I delve too far here want to get clarity on this topic.

Thanks for the ongoing help here.

#19

BoldMinded (Brian)

You can make the blog entries a managed “asset” in Structure, so its still available through Structure.

Yes, {publisher:entry_status} is required for any template that may need to show a draft. Its mainly for instances when the entry is brand new and only has a draft available. It needs to know when to add “open|Draft” to the status value to the parameter. A new entry will only have a “Draft” status, an existing entry would probably have an “open” status, as well as “Draft” status, so it needs bothvalues to display a preview.

#20

derek allard

If we made it an asset, though, the blog would be out of the tree and on the assets tab … not a bad idea but will have to run this by the client. Right … Assets don’t have templates associated with them so they wouldn’t try to render differently.

Thanks for clarifying on the publisher:entry_status … will get to work on those. Are there any other tags that Publisher absolutely needs in the templates (just so we don’t have to go through things multiple times if at all possible).

#21

BoldMinded (Brian)

There are no other must have tags, but still review the docs just incase you need anything else.

#22

derek allard

Of course. Thanks for clarifying. I appreciate the quick replies here.

#23

derek allard

Hi Brian … We’re back on this after a hold from the client. Today we switched to have the blog channel set as an asset but the preview is still loading /blog/title instead of blog/post/title … we tried using the template preview URL override and defining the template. Do we need to make this completely unmanaged by structure for these to work? Ideally would like to keep the blog managed in structure somewhere. Please advise.

#24

BoldMinded (Brian)

If its an “Asset” in Structure, then you need to us the template preview option. Its only if its a page or listing in Structure does it not need a preview template defined.

Grab the latest version of Publisher and clear the site’s cache to be sure the draft previews are cleared. Publisher caches urls for previews so it doesn’t have to re-generate them and do extra work too often.

#25

derek allard

Hi Brian,

I cleared the cache on the site but unfortunately the URL issue persists. I have added CP details to the ticket, if you have a quick second I would appreciate you seeing if you can find anything. I will work on getting the latest version of Publisher in there.

Thanks

#26

BoldMinded (Brian)

Only the latest version of Publisher clears the cache that needs to be cleared.

#27

BoldMinded (Brian)

Have you tried replicating this with a new test channel and templates? E.g create a new channel, a new template group with index.html and post.html, and only the entries tag inside of post.html to see if the same thing happens.

#28

derek allard

Hi Brian,

Installing the most recent version of the software and clearing the cache fixed the issue. Thank you very much for your time in resolving this bug and the guidance you provided.

Thanks again

Login to reply