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: Component displaying open content instead of draft content when in draft mode

Status Resolved
Add-on / Version Publisher Lite 3.11.1
Severity
EE Version 7.4.3

Siân

Mar 18, 2024

Description of the problem

It’s a bit of a strange problem that we don’t understand, but…

We have a page that is made up from multiple embed ‘components’, each of which calls the {exp:channel:entries} tag and they are all hooked up with the status=”{publisher:entry_status}” parameter. We are then using the {exp:publisher:toolbar} tag links to switch between open and draft mode.

I have a draft version of a page. When I view it on the front end in draft mode, most of the embeds are showing the draft content except for one of them, which appears to be showing the open content. If I view the value of {publisher:entry_status}, it shows ‘open|Draft’ and if I look at one of the underlying SQL queries, I can see it is effectively doing this:

AND t.status IN (‘open’,’Draft’) AND t.status != ‘closed’ ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc

But this feels like it wouldn’t necessarily always bring out draft as it’s not ordered to, but then I would have expected all of the other embeds to come out with the same order as this component. Any suggestions on why this might be happening?

Here is the relevant code for the component that is having the issue:

<!-- social feed -->
{exp:channel:entries disable="categories|member_data|pagination" dynamic="off" entry_id="{embed:id}" url_title="{embed:segment}" status="{publisher:entry_status}"}
<section class="social-feed section">
  <div class="container">
    <div class="row">
      <div class="col-md-8 section__intro">
        <h2 class="h1 mb-3">{instagram_feed_title}</h2>
        <p>{instagram_feed_copy}</p>
      </div>
    </div>
    <div class="row social-feed__tiles">
      ...
    </div>
  </div>
</section>
{/exp:channel:entries}

How To Reproduce It’s difficult to explain how to reproduce this but would be happy to jump on a screen share if that’s helpful.

Error Messages n/a

Screenshots / Videos / Template Code n/a

Environment Details: - Version: 3.11.1 - PHP Version 8.2.6 - MySQL Version 8.0.33 (mariaDB) - OS: macOS - Web Server: nginx

Possible Solution

Additional context

#1

BoldMinded (Brian)

I don’t see any licenses of Bloqs under your account. What is your order # and what is the Bloqs license #?

#2

BoldMinded (Brian)

Sorry you said component and I thought you were talking about a Bloqs feature.

This sounds like an issue where some open content is being displayed because there is no draft version of it. Check the docs https://docs.boldminded.com/publisher/docs/persistence

#3

Siân

Comment has been marked private.

#4

BoldMinded (Brian)

Thanks for narrowing it down to the pagination parameter… it sounds like an obscure bug that I’ll have to look into. Not sure when I’ll be able to dedicate time to it though.

What are your persistence and fallback settings set to in Publisher so I can make sure I can replicate this locally? (screenshots can help)

#5

Siân

Thank you for getting back to us.

We couldn’t find any persistence settings within the addon settings - could this be because we are on Publisher Lite rather than the full version?

Fallback settings are all untouched and set to the default settings - everything within the Content Display settings is toggled on, except for ‘Always show fallbacks for Drafts?’.

#6

Siân

PS. We also noticed that if we had an order attribute (both asc and desc) on exp:channel:entries, that also seemed to stop the draft from working in the same way as the pagination.

#7

BoldMinded (Brian)

Can you give me some more context? Maybe a video walking me through the scenario? Does the entry that is showing open content instead of draft have an open and draft version of the entry? What about the other entries that are correctly showing the draft content? Do they have any open/published versions of those entries?

#8

BoldMinded (Brian)

Checking in… are you able to make a video and give me some more context?

#9

Siân

Comment has been marked private.

#10

BoldMinded (Brian)

Thanks for the video and walk through. Are you able to replicate this without all the components and embed? Just make a single test template file, no excessive markup or styles, with a single entries tag listing out the content of a few entries.

#11

BoldMinded (Brian)

Literally break it down to only the bare necessities needed to re-create the issue… remove the excess noise.

#12

BoldMinded (Brian)

Here is what I tested locally and everything seems to work fine. Two entries tags (and a 3rd which isn’t in the video, but the behavior is the same and works as expected) and the draft and open content displays as expected. I’ll need to you re-create the issue in your environment using similar tags, or changes to the following tags to replicate the issue before I can spend additional time investigating this.

{exp:publisher:toolbar}
publisher:entry_status: {publisher:entry_status}

<h1>Pages</h1>
{exp:channel:entries
    channel="pages"
    disable="categories|member_data"
    dynamic="no"
    status="{publisher:entry_status}"
    limit="3"
}
    <h2>{title}</h2>
    {summary}
    <hr >
{/exp:channel:entries}

<h1>People</h1>
{exp:channel:entries
    channel="people"
    disable="categories|member_data|pagination"
    dynamic="no"
    status="{publisher:entry_status}"
}
    <h2>{title}</h2>
    {basic_text_field}
    <hr >
{/exp:channel:entries}

{embed="test/draft-embed"} // This embed is identical to the previous "people" entries tag, just to test if anything changes when it's in an embed, and it did not.

Login to reply