Forum

Thread tagged as: Problem

Blog post not saving changes

Hello. I'm facing weird problems with a Perch blog where changes wan't be saved or even content gets lost after successful save. Blog posts use blocks. Specifically when adding an image or text block and hit save, apparently everything works fine but content has not really been saved. I'm not talking about missing to fill in a mandatory field. The page reloads and no errors are shown. After adding the content again and saving, it usually works. Until now we only had frustrating but minor problems like this. Yesterday however when we were adding a fairly big post and while we were getting close to finish it, after a save almost half of the content just disappeared and now we can't edit it anymore. Adding or removing content has absolutely no effect.

We are really blocked here. Anyone has ever faced similar problems? Any idea would be highly appreciated.

Proko Mountrichas

Proko Mountrichas 3 points

  • 3 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please post your template and Diagnostic Report.

Hello and sorry for the delay.

My diagnostics:

Perch Runway: 3.1.1, PHP: 7.0.31-1~dotdeb+8.1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_blog (5.6.1), perch_forms (1.11), perch_shop_orders (1.2.6), perch_shop_products (1.2.6), perch_shop (1.2.6), perch_members (1.6.4), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', 'perch_shop', 'perch_mailchimp', 'perch_forms', );
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/153377.cloudwaysapps.com/zbmshpfskk/public_html/admin
PERCH_CORE: /home/153377.cloudwaysapps.com/zbmshpfskk/public_html/admin/core
PERCH_RESFILEPATH: /home/153377.cloudwaysapps.com/zbmshpfskk/public_html/admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 50M, Max POST 50M, Memory: 128M, Total max file upload: 50M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
REQUEST_URI: /admin/core/settings/diagnostics/
DOCUMENT_ROOT: /home/153377.cloudwaysapps.com/zbmshpfskk/public_html/
HTTP_HOST: annaand.co

Template:

<perch:blog id="customPostSlug" type="slug" for="postUrl" editable="false" suppress="true"/>
<perch:blog id="postUrl" type="text" label="URL del Post" size="xl autowidth" order="1" suppress="true" help="Sin acentos, ñ y ç ni símbolos" />
<div class="blogpost__heroewrapper">
    <perch:template path="blog/heroe_image.html" />
    <h1 class="blogpost__title">
        <span class="blogpost__titletext"><perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="3" /></span>
    </h1>
</div>
<div class="blogpost__meta">
    <perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes">
        <span class="blogpost__category">
            <perch:category id="catTitle" type="text" />
        </span>
    </perch:categories>
    <time class="blogpost__date" datetime="<perch:blog id="postDateTime" type="date" label="Date" format="Y-m-d H:i:s" divider-before="Publishing" />">
        <perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" />
    </time>
</div>
<div class="blogpost__body">
    <perch:blocks>
        <perch:block type="text" label="Texto" icon="pencil">
            <div class="simpletext__base simpletext--editor">
                <perch:blog id="simple-text" type="textarea" label="Texto Simple" html="true" editor="redactor_reduced" />
            </div>
        </perch:block>
        <perch:block type="linkText" label="Link nofollow" icon="paperclip">
            <perch:template path="content/text_link.html" rescope="parent" />
        </perch:block>
        <perch:block type="image" label="Imagen" icon="photo">
            <perch:template path="blog/body_image.html" />
        </perch:block>
        <perch:block type="textImage" label="Imagen + Texto" icon="yin-yang">
            <div class="block_textImage__base">
                <div class="block_textImage__media">
                    <perch:template path="blog/body_image.html" />
                </div>
                <div class="block_textImage__text">
                    <perch:blog id="simple-text" type="textarea" label="Texto Simple" html="true" editor="redactor_reduced" />
                </div>
            </div>
        </perch:block>
        <perch:block type="doubleImage" label="Imagen Doble" icon="photos">
            <perch:template path="blog/double_image.html" />
        </perch:block>
        <perch:block type="amazon" label="Link afiliado" icon="redirect">
            <p class="textblock"><perch:blog id="amazon" type="textarea" label="Texto" html="true" help="Escribe la frase y pega el codigo directamente"/></p>
        </perch:block>
        <perch:block type="list" label="listado" icon="list">
            <perch:template path="content/list.html" rescope="parent" />
        </perch:block>
        <perch:block type="textPanel" label="Panel-Texto" icon="pencil-paintbrush-pen">
            <perch:template path="content/text_panel.html" rescope="parent" />
        </perch:block>
        <perch:block type="quote" label="Quote" icon="quote">
            <perch:template path="blocks/_blockquote.html" rescope="parent" />
        </perch:block>
    </perch:blocks>
</div>
<perch:blog id="excerpt" type="textarea" label="Excerpt" markdown="true" order="4" suppress="true" size="s" />
<perch:blog id="featured" type="checkbox" label="Promocionado" value="si" suppress="true"/>
<perch:blog id="image" type="image" width="400" height="200" crop="true" suppress="true" />

I suspect that some configs I previously had on my server have been reset after some changes I've done. Do you see anything that could be related bellow?

Anyone with some experience hosting PHP-MySql sites?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your have the postDescHTML field missing, and other fields have illegal IDs with dashes. I'd start there.

If that doesn't help, test with the default template to see if the problem still exists. If it doesn't then the issue stems from your template.