Weird duplication bug

Hi there,

I’ve come across a strange issue while building a new site using cornerstone.

It seems that the page content is being rendered twice in the DOM on the frontend.
In the HTML output, I can see the same post element duplicated:

<div class="x-main full" role="main">
    <article id="post-8" class="post-8 page type-page status-publish hentry no-post-thumbnail">...</article>
    <article id="post-8" class="post-8 page type-page status-publish hentry no-post-thumbnail">...</article>
</div>

The exact same page (same post ID) is output twice, which results in the full content being displayed twice.

This only happens on the frontend. Inside the Cornerstone editor everything appears correctly (no duplicated content). I’m currently using a blank template.

Any idea what could cause this? (details are in the secure note)

Thanks in advance!

I have this problem on one page of my site too.

1 Like

Are there any kind of loopers on the page that would help me understand what’s going wrong?

Boy, oh boy, that’s been driving me crazy, but that was exactly the issue for me. In my case, it was a portfolio page where I had a layout with a container pulling in the_content, but it was apparently duplicating it because I had the consumer is set to all. Switched it to one and it’s fine. In this particular portfolio project, I happened to have two categories assigned to it, whereas all the others had just one, so it was the only one exhibiting the problem.

Thanks @Charlie!

2 Likes

Anytime.

@sparko did my comment help you out at all?

Hey Charlie,

There is one Looper using a JSON source and another one displaying recent posts on that page. Both are placed inside sections though, so they shouldn’t be causing the entire page content to be duplicated.

I’ll report back once I’ve had a chance to investigate this further.

@sparko, if it’s at all helpful, what I did was view the page source of the problematic page, copy it all, and give it to Claude to ask if it could tell why there was duplicate content – and it instantly keyed in on the problem for me. Worth a shot if you haven’t already tried that.

1 Like

thanks for chiming in @devinelston! I’ve been trying to debug this with ChatGPT for a while, but haven’t resolved it yet. The page source itself looks fine, but all sections are still being output twice. I even removed all loopers from that page and it still happened.

@charlie do you want access to cornerstone on this page to investigate this yourself?

Yeah let me checkout the site and I’ll see what’s going on. I would also try switching stacks or disabling any caching plugins that might be there just to isolate the issue. Have a great weekend.

login credentials are attached in the secure note

@charlie is there a quick fix/workaround for this? The site needs to go live within the next two days.

That login did not work for unfortunately.

Resetted the password

You had a Consumer without a provider in the element labeled “Title”, which sounds similar to what Devin said. I think the “Rewind” also messes with the output as that usually resets the current looped item, which would be the Page itself I think. Let me know if that helps.

image

Thank you so much. Everything is back to normal. This was driving me crazy!

Is this considered to be a bug? I mean, it shouldn’t output all sections twice, even when there’s a consumer without a provider somewhere on that site, right?

No problemo. I can add guard rails for rewind when it’s on a single post. Have a great day.

1 Like