Forum

Thread tagged as: Problem

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?

Nick Loat

Nick Loat 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

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.

Perch: 2.8.7
Production mode: Production (100)
Installed apps: content (2.8.7), assets (2.8.7), categories (2.8.7), perch_blog (4.6)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:

<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_blog',
    );
?>

Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, redactor
H1: dd0ea74bdf34bbcf0d815fa414c72b0e
L1: 467d424deeb22d204b27f14dd1510e46
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.7: done
latest_version: 2.8
on_sale_version: 2.8.7
perch_blog_update: 5.0
perch_blog_post_url: /blog/post.php?s={postSlug}
headerScheme: light
dashboard: 1
content_hideNonEditableRegions: 1
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_comment_notify: 1
perch_blog_max_spam_days: 1
hide_pwd_reset: 0
content_frontend_edit: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: cl43-minerva
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: cl43-minerva
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: nick@loatdavies.com
PERCH_EMAIL_FROM_NAME: Nick Loat
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/sites/minervasimulators.com/public_html/admin
PERCH_CORE: /home/sites/minervasimulators.com/public_html/admin/core
PERCH_RESFILEPATH: /home/sites/minervasimulators.com/public_html/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/sites/minervasimulators.com/public_html/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:

Hosting settings

PHP: 5.5.20
Zend: 2.5.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $
MySQL server: 5.5.42
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, bcmath, curl, dom, enchant, fileinfo, gd, imap, intl, json, ldap, exif, mcrypt, mssql, mysqlnd, mysql, mysqli, odbc, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, recode, soap, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 64M
PHP max form post size: 64M
PHP memory limit: 128M
Total max uploadable file size: 64M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
PATH: /usr/local/bin:/usr/bin:/bin
UNIQUE_ID: VXGcqX8AAAEAAETAg1EAAAAE
SCRIPT_URL: /admin/core/settings/diagnostics/
SCRIPT_URI: https://minervasimulators.com/admin/core/settings/diagnostics/
HTTP_HOST: minervasimulators.com
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_DNT: 1
HTTP_REFERER: https://minervasimulators.com/admin/core/settings/diagnostics/
HTTP_COOKIE: __atuvc=67%7C22; PHPSESSID=2oumus9gr3girs57t3iso0f4u7; cmsa=1; __atuvs=557194d0ed10ea6b017; __atrfs=ab/|pos/|tot/|rsi/55719c8300000000|cfc/|hash/0|rsiq/|fuid/7b60b826|rxi/|rsc/|gen/1|csi/|dr/
HTTP_CONNECTION: close
SERVER_SIGNATURE: <address>Apache/2.4.10 (Unix) Server at minervasimulators.com Port 80</address>
SERVER_SOFTWARE: Apache/2.4.10 (Unix)
SERVER_NAME: minervasimulators.com
SERVER_ADDR: 10.0.1.241
SERVER_PORT: 80
REMOTE_ADDR: 92.23.30.149
DOCUMENT_ROOT: /home/sites/minervasimulators.com/public_html/
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /home/sites/minervasimulators.com/public_html/
SERVER_ADMIN: webmaster@minervasimulators.com
SCRIPT_FILENAME: /home/sites/minervasimulators.com/public_html/admin/core/settings/diagnostics/index.php
REMOTE_PORT: 44493
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1433509033.1403
REQUEST_TIME: 1433509033
Drew McLellan

Drew McLellan 2638 points
Perch Support

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

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, thanks, we'll try to reproduce this.

Drew McLellan

Drew McLellan 2638 points
Perch Support

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 ON perch2_resource_log SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cl43-minerva.perch2_resource_log' doesn't exist

The following error occurred: ALTER IGNORE TABLE perch2_resource_log ADD UNIQUE INDEX idx_uni (appID, itemFK, itemRowID, resourceID) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cl43-minerva.perch2_resource_log' doesn't exist

Not sure how to rectify.

Drew McLellan

Drew McLellan 2638 points
Perch Support

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.

Drew McLellan

Drew McLellan 2638 points
Perch Support

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?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You had a missing table, but Perch fixed it.

Fab. That's what makes it so great to use + the awesome support of course!