Forum

Thread tagged as: Problem, Blog

Cannot publish blog posts after update

I recently updated a client to 2.5.4 and the latest blog app. They're having a problem publishing posts from a draft state after modifying the post.

So say they've got a post with some text in it, and then they change one of the sentences and add a couple of photos, then adjust the toggle from draft to published and hit the save button, the page hangs and 'gets stuck' and the green save banner doesn't appear.

Then their changes aren't saved on reload.

Any idea what might be going on?

Gary Iverson

Gary Iverson 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your blog post.html template?

Sure. Here's the post template:

` <article class="post">
<div class="row">
<perch:if exists="author_image"> <div class="two hide-for-small columns"> <img class="author" src="<perch:blog id="author_image" type="image" label="Author Image" help="Disregard field if author photo has already been uploaded." width="120" height="120" crop="true" density="2" order="6" divider-before="About the Author" />" width="120" height="120" alt="<perch:blog id="authorGivenName" type="text" label="First name" order="7" /> <perch:blog id="authorFamilyName" label="Last name" type="text" order="8" />" /> </div> <div class="ten mobile-twelve columns"> <perch:else/> <div class="twelve columns"></div> </perch:if> <h3><a href="<perch:blog id="postURL" type="hidden">" rel="bookmark" class="entry-title"><perch:blog id="postTitle" order="1" label="Post Title" type="text" required="true" size="xl" /></a></h3> <p class="postedby">Posted by <perch:blog id="authorGivenName" /> <perch:blog id="authorFamilyName" /> at <perch:blog id="postDateTime" type="hidden"format="g:ia"/> on <perch:blog id="postDateTime" type="date" format="F jS, Y" /> in <a style="text-transform:capitalize;color:#006163;font-weight:600;" href="archive.php?cat=<perch:blog id="category_slugs"type="hidden" />"><perch:blog id="category_names" type="hidden"/></a> | <a class="commentCount"href="#comments"><i class="fa fa-comments"></i> <perch:blog id="postCommentCount"type="hidden"/> Comments</a></p> </div>
</div> <perch:if exists="postPhoto"> <img src="<perch:blog id="postPhoto" type="image" label="Image" order="2" required="false" />"alt="<perch:blog id="postPhotoAlt" type="text" label="Image Description" order="3"/>"/> </perch:if>

<div class="article">
    <perch:blog id="postDescHTML" type="textarea" html="true" encode="false" editor="redactor" size="xxl" order="3" required="true" />
        <perch:if exists="postAuthorInfo">
        <h4>About the Author</h4>
            <div class="row">
            <div class="two columns">
                <img class="author" src="<perch:blog id="author_image"/>">
            </div>
            <div class="ten columns">
                <perch:blog id="postAuthorInfo" type="textarea" html="true" editor="redactor" order="9" required="false"/>
            </div>
            </div>
        </perch:if>
<hr>
</div>
<div class="row">
    <div class="twelve columns">
         <div id="disqus_thread"></div>
    </div>
</div>

</article> <perch:blog id="excerpt" type="textarea" label="Excerpt" editor="redactor" html="true" divider-before="Post Excerpt" suppress="true" size="s" /> `

Nothing comes up as an error that I can tell in the debug info:


SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled='1' AND u.userID=1 AND u.userHash='d12509932e70d112290bcb048748cd6a' LIMIT 1 UPDATE perch2_users SET userHash='e99ec51631b1062d6635cff1ea6c1496' WHERE userID=1 SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID SELECT * FROM perch2_blog_categories ORDER BY categoryTitle ASC SELECT * FROM perch2_blog_authors WHERE authorEmail='gary@garyriverson.com' LIMIT 1 SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC Using template: /templates/blog/post.html SELECT COUNT(*) FROM perch2_blog_comments WHERE commentStatus='PENDING' SELECT *

FROM perch2_blog_authors ORDER BY authorFamilyName, authorGivenName ASC

Rachel Andrew

Rachel Andrew 394 points
Perch Support

How large are the photos they add? Have you tried with the exact same images? Can they create a new post with the exact same data (not from draft)?

I'm not sure on that. I'll ask.

One photo is 62kb. The other is 480kb. I've tried with the images and text and cannot recreate the problem. I've also tried creating new posts with the same data as the draft posts that are having issues and those publish successfully. And I've tried changing a post from draft to published, which also saves successfully. So I can't recreate their issue.

And I've not heard about the issue reoccuring since. One thought I have is that their internet connection may have dropped out while editing/saving the post. But I don't know. I'm speculating.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I think this sounds like a local issue at their end. If they come back with more evidence of it happening again then let us know but I don't think it is Perch-related at the moment.

I've just received an email that the issue is happening again, along with a screenshot.

Sorry that post could not be updated

Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version did you update from?

We updated from Blog 3.9 and Perch 2.4.9.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you update your post.html correspondingly? https://docs.grabaperch.com/docs/blog/installation/

I copied the example and plugged in our fields, but I've had a sudden realization that some of the fields, like author name, aren't assigned to the type="hidden". Also, when I reuse a field in the template, do I need to include the type and label attributes for the reused fields in addition to the original?

Like say this is my original field: <perch:blog id="thing1" type="text" label="thing"/>

And then I want that to show up somewhere else on the same page, can I just do:

<perch:blog id="thing1"/>

Or do I need the whole thing with type set to hidden?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You need a minimum of id and type, although if you don't specify type it defaults to text.

Ah, ok. It turned out it was one of the author name fields wasn't set to hidden; always something simple I skip over in the docs it seems.

Thanks again for your continually fantastic support.