Forum
Deleting the first block appears to delete all blocks
I've set up some layout options using blocks in blog. If a post has been published using two or more block and then subsequently the first block is deleted and the post republished all blocks are lost. is this a bug or have I done something wrong?
Can you post your diagnostics?
Hang on might be a php version problem. I'll check and re test
Hi Drew,
Just updated php and then reconducted the test and the same problem occured (i.e. all blocks were deleted) please find diagnostics below.
Hosting settings
Can you show us your template and the steps you're going through to reproduce the issue?
Here's the template…
<!--Blog post layout-->
<article class="h-entry news clearfix"> <h1> <!--<a href="<perch:blog id="postURL" type="hidden" />" rel="bookmark" class="p-name">--> <perch:blog id="postTitle" type="smarttext" label="Title" required="true" size="xl autowidth" order="1" /> <!--</a>--> </h1> <p class="meta"> <time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Meta information" /> "> <perch:blog id="postDateTime" type="date" time="true" format="%B %Y" /> , </time> <perch:if exists="categories"> Published in: </perch:if> <perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes"> <a href="archive.php?cat=<perch:category id="catSlug" type="slug" />" class="p-category"> <perch:category id="catTitle" type="text" /> </a> </perch:categories> </p>
<!--Blog blocks--> <perch:blocks order="3">
<!--BLOCK Just text--> <perch:block type="justtext" label="Text only"> <div class="description e-content"> <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="redactor" html="true" size="xxl autowidth" required="true" /> </div> </perch:block>
<!--*BLOCK Two columns *--> <perch:block type="2col" label="2 Columns"> <div class="news-cols clearfix"> <div class="col-2 clearfix" > <img src="<perch:blog id="image1" type="image" label="Image"/>" alt=" <perch:blog id="alt1" type="smarttext" html="true" label="Alt text"/> " style="width:100%;margin:0 0 9px;"/> <h3> <perch:blog id="sub1" type="smarttext" html="true" label="Subhead"/> </h3> <perch:blog id="col1" type="textarea" label="Column 1 text" order="2" editor="redactor" html="true" size="xxl autowidth" required="true" /> </div> <div class="col-2 clearfix" style="margin-left:3.5%"> <img src="<perch:blog id="image2" type="image" label="Image"/>" alt=" <perch:blog id="alt2" type="smarttext" html="true" label="Alt text"/> " style="width:100%;margin:0 0 9px;"/> <h3> <perch:blog id="sub2" type="smarttext" html="true" label="Subhead"/> </h3> <perch:blog id="col2" type="textarea" label="Column 2 text" order="2" editor="redactor" html="true" size="xxl autowidth" required="true" /> </div> </div> </perch:block>
<!--BLOCK Text + image right--> <perch:block type="textrightimg" label="Text/image"> <perch:if exists="image"> <figure class="blog-text-img"> <img src="<perch:blog id="image" type="image" crop="true" label="Image"/>" alt=" <perch:blog id="figcap" /> " class="imgright"/> <figcaption> <perch:blog id="figcap" type="smarttext" html="true" label="Caption"/> </figcaption> </figure> </perch:if> <perch:if exists="mp4"> <figure style="float:right;margin:0 0 0 20px; width:48.25%;border:0;"> <video controls style="width:100%;" > <perch:if exists="mp4"> <source src="<perch:blog id="mp4" type="image" label="Video: mp4"/> " type="video/mp4"></perch:if> <perch:if exists="ogg"> <source src="<perch:blog id="ogg" type="image" label="Video: ogg"/> " type="video/ogg"></perch:if> <perch:if exists="webm"> <source src="<perch:blog id="webm" type="image" label="Video: webm"/> " type="video/webm"></perch:if> <p>Sorry… your browser does not support the HTML5 video tag.</p> </video> <figcaption> <perch:blog id="figcap" type="smarttext" label="Caption"/> </figcaption> </figure> </perch:if> <div class="description e-content"> <perch:blog id="postDescHTML" type="textarea" label="Post" editor="redactor" html="true" size="xxl autowidth" required="true" /> </div> </perch:block>
<!--BLOCK: Image left--> <perch:block type="textleftimg" label="Image/text"> <perch:if exists="image"> <figure class="blog-text-img"> <img src="<perch:blog id="image" type="image" width="320" height="240" crop="true" label="Image" />" alt=" <perch:blog id="figcap" /> " class="imgleft"/> <figcaption> <perch:blog id="figcap" type="smarttext" label="Caption" /> </figcaption> </figure> </perch:if> <perch:if exists="mp4"> <figure style="float:left;margin:0 20px 0 0px; width:48.25%;border:0;"> <video controls style="width:100%;" > <perch:if exists="mp4"> <source src="<perch:blog id="mp4" type="image" label="Video: mp4"/> " type="video/mp4"></perch:if> <perch:if exists="ogg"> <source src="<perch:blog id="ogg" type="image" label="Video: ogg"/> " type="video/ogg"></perch:if> <perch:if exists="webm"> <source src="<perch:blog id="webm" type="image" label="Video: webm"/> " type="video/webm"></perch:if> <p>Sorry… your browser does not support the HTML5 video tag.</p> </video> <div class="description e-content"> <perch:blog id="postDescHTML" type="textarea" label="Post" editor="redactor" html="true" size="xxl autowidth" required="true" /> </div> </perch:block>
<!--BLOCK: Full width image--> <perch:block type="fullwidthimg" label="Full width image"> <perch:if exists="image"> <figure class="blog-main-img"> <img src="<perch:blog id="image" type="image" label="Image"/>" alt=" <perch:blog id="figcap" /> " /> <figcaption> <perch:blog id="figcap" type="smarttext" html="true" label="Caption"/> </figcaption> </figure> </perch:if> </perch:block> </perch:blocks> </article>
<!--Blog excerpt--> <perch:blog id="excerpt" type="textarea" label="Excerpt" editor="redactor" html="true" order="2" suppress="true" size="s" />
<!--Blog Thumbnails--> <perch:blog id="blogthumb" type="image" crop="true" label="Thumbnail" divider-before="Post thumbnail" suppress="true" /> <perch:blog id="blogthumbalt" type="text" label="Alt text" suppress="true" /> <perch:blog id="blogthumbcredit" type="text" label="Photogrpaher" suppress="true" />
Steps…
1: Add a text only block (enter data) 2: Add a Text + image block (enter data) 3: Add a full image block (enter data) 4: Publish post 5: Edit post deleting the text only block 6: Click save.
All blocks disappear
Ok, thanks, we'll try to reproduce this.
This should be fixed now in 2.8.8.
Brilliant, many thanks I'll give it a go.
Hi Drew just updated to 2.8.8 and got the following errors…
The following error occurred: DROP INDEX
idx_uni
ONperch2_resource_log
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cl43-minerva.perch2_resource_log' doesn't existThe following error occurred: ALTER IGNORE TABLE
perch2_resource_log
ADD UNIQUE INDEXidx_uni
(appID
,itemFK
,itemRowID
,resourceID
) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cl43-minerva.perch2_resource_log' doesn't existNot sure how to rectify.
Is this related to the above issue, or something completely new?
Its related to the above. I've only just updated the site this morning to check out the fix.
Ok. If you reload the page, do you still get the errors or have they been fixed?
Yep. all looks OK. what was the problem?
You had a missing table, but Perch fixed it.
Fab. That's what makes it so great to use + the awesome support of course!