Forum

Thread tagged as: Problem, Addons, Blog

Issues with Blog after a Perch and Blog update, changes not being saved.

Hi

Happy New Year!

I am having trouble with the Blog add-in since upgrading a website. The website was on a low 2.x and I've just upgraded it to the latest version of Perch along with the latest versions of the Blog, Gallery and Events addins.

All seems fine except with the blog add-in. I can delete posts but I can't add them. I seem to be able to change some fields and not others. Ie, I can make the changes in the form as an editor or admin but the changes don’t get written to the database and hence not shown on the website. More specifically, with the blog posts, in the ‘Post’ section I don’t seem to be able to change anything and have the changes successfully saved. I can change date and categories in the 'Publishing' section but not the 'Published/draft' status. In the ‘Meta data’ section, I can successfully add a tag but it no longer is displayed in the post form after a 'save'.

The symptoms are the same whether locally using WAMP on Windows 10 or at a staging post on my production server.

I initially adapted my old post.html template but to elimate any issue there, I tried the supplied default post template and the same issue persisted.

I can go direct to the perch2_blog_posts table and make changes and that seems to work fine.

Is there something obvious that might be causing this?

Any help would be gratefully received, obviously let me know if further information would be useful.

Diags Summary... ~~~ Summary information

Perch: 3.1.3, PHP: 5.6.35, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (3.1.3), assets (3.1.3), categories (3.1.3), perch_blog (5.6.1), perch_events (1.9.5), perch_gallery (2.8.9)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_events', 'perch_gallery', ); ?>
PERCH_LOGINPATH: /webdev2018/tma/tma-live/perch
PERCH_PATH: C:\wamp64\www\webdev2018\tma\tma-live\perch
PERCH_CORE: C:\wamp64\www\webdev2018\tma\tma-live\perch\core
PERCH_RESFILEPATH: C:\wamp64\www\webdev2018\tma\tma-live\perch\resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: localhost
DOCUMENT_ROOT: C:/wamp64/www
REQUEST_URI: /webdev2018/tma/tma-live/perch/core/settings/diagnostics/
SCRIPT_NAME: /webdev2018/tma/tma-live/perch/core/settings/diagnostics/index.php
mark buckley

mark buckley 0 points

  • 2 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

We need to see your blog template.

Hi Rachel, Thanks for this.

Please find below, although as mentioned I also tried with the defaul template supplied with the Blog release and the same problems seemed to occur. Please let me know if you need anything else.

Cheers - Mark

Here goes:

~~~ <div class="hentry"> <h1><perch:blog id="postTitle" type="text" label="Name of this beer" required="true" order="1"/></h1>

<perch:blog id="abv" type="text" label="ABV for this beer OR if it's a bottom lhs quote then the author OR if it's a bottom rhs word definition then the source" textile="true" order="2" suppress="true" />

<perch:blog id="brewery-name" type="text" label="Name of brewery OR if it's a bottom rhs word definition then the source (remainder)" editor="markitup" textile="true" order="3" suppress="true" />

<perch:blog id="image" type="image" width="120" height="150" crop="true" suppress="true" order="4" required="false"/> <perch:blog id="postDescHTML" type="textarea" label="Tasting notes" textile="true" order="5"/>

<perch:if exists="image"> <div><img src="<perch:blog id="image" type="image" width="400" height="500" crop="true" label="Post image" />" alt="<perch:blog id="postTitle" />" /></div> </perch:if>

<perch:blog id="brewery-desc" type="textarea" label="Brewery notes" editor="markitup" textile="true" order="6" suppress="true" /> </div>

<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="Publishing" />"> <perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" /> </time> <perch:if exists="authorGivenName"> by <span class="p-author h-card"><perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" /></span> </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>

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you turn on debug and save a post, do you get any errors displayed?

Hi Drew, yes and I get the output below. There is an error about 12 lines down (and repeating a couple of times later) complaining about unknown column 'PostTemplate'.

  • sounds bad but not sure where the issue is.

Cheers - Mark

~~~ Debug Message - Perch 3.1.3 [1] 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='9caa37f557af3e4a6458dd656e499ce0' LIMIT 1 UPDATE perch2_users SET userHash='cc4f881188c94812f0dd491944335d0f' WHERE userID='1' [15] SELECT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC [9] SELECT itemValue FROM perch2_menu_items WHERE itemType='app' [0] SELECT COUNT() FROM perch2_blog_comments WHERE commentStatus='PENDING' [1] SELECT * FROM perch2_blog_authors WHERE authorEmail='mark@dtew.co.uk' LIMIT 1 [1] SELECT * FROM perch2_blog_posts WHERE postID=942 [1] SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC [1] SELECT * FROM perch2_blogs ORDER BY blogTitle ASC Looking up missing property postTemplate SELECT postTemplate FROM perch2_blog_posts WHERE postID='942' [0] Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'postTemplate' in 'field list' [1] SELECT * FROM perch2_blogs WHERE blogID=1 LIMIT 1 [1] SELECT * FROM perch2_blog_sections WHERE blogID='1' ORDER BY sectionTitle ASC Using template: \templates\blog\post.html INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceFileSize,resourceWidth,resourceHeight,resourceTitle) VALUES('perch_blog','default','ampm.png','orig',0,'png','2019-01-02 09:46:46','0',309184,400,500,'Ampm') [1] SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='ampm.png' LIMIT 1 INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceWidth,resourceHeight,resourceFileSize,resourceTitle) VALUES('perch_blog','default','ampm-thumb.png','thumb','21','png','2019-01-02 09:46:46','0',120,150,34126,'Ampm thumb') [1] SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='ampm-thumb.png' LIMIT 1 INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceWidth,resourceHeight,resourceFileSize,resourceTitle) VALUES('perch_blog','default','ampm-w120h150.png','w120h150c1','21','png','2019-01-02 09:46:46','0',120,150,34126,'Ampm w120h150') [1] SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='ampm-w120h150.png' LIMIT 1 INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceWidth,resourceHeight,resourceFileSize,resourceTitle) VALUES('perch_blog','default','ampm-w400h500.png','w400h500c1','21','png','2019-01-02 09:46:46','0',400,500,309184,'Ampm w400h500') [1] SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='ampm-w400h500.png' LIMIT 1 [1] SELECT * FROM perch2_categories WHERE catID=5 LIMIT 1 [1] SELECT * FROM perch2_categories WHERE catID=2 LIMIT 1 Logging resources for perch_blog DELETE FROM perch2_resource_log WHERE appID='perch_blog' AND itemFK='postID' AND itemRowID=942 INSERT IGNORE INTO perch2_resource_log(appID, itemFK, itemRowID, resourceID) VALUES('perch_blog','postID',942,21),('perch_blog','postID',942,22),('perch_blog','postID',942,23),('perch_blog','postID',942,24) UPDATE perch2_blog_posts SET postStatus='Published', postTemplate='post.html', postDescRaw='A frooty session IPA', postDescHTML='<p>A frooty session <span class=\"caps\">IPA</span></p>', postTitle='AM:PM', postDateTime='2018-12-21 20:31:00', postDynamicFields='{\"abv\":\"4.5%\",\"brewery-name\":\"Thronbridge\",\"image\":{\"_default\":\"\/perch\/resources\/ampm.png\",\"path\":\"ampm.png\",\"size\":309184,\"bucket\":\"default\",\"w\":400,\"h\":500,\"sizes\":{\"thumb\":{\"w\":120,\"h\":150,\"path\":\"ampm-thumb.png\",\"size\":34126},\"w120h150c1\":{\"w\":120,\"h\":150,\"path\":\"ampm-w120h150.png\",\"size\":34126},\"w400h500c1\":{\"w\":400,\"h\":500,\"path\":\"ampm-w400h500.png\",\"size\":309184}}},\"brewery-desc\":{\"_flang\":\"textile\",\"raw\":\"\\"thornbridgebrewery.co.uk\\":https:\/\/thornbridgebrewery.co.uk\",\"processed\":\"<p><a href=\\"https:\/\/thornbridgebrewery.co.uk\\">thornbridgebrewery.co.uk<\/a><\/p>\"},\"categories\":[\"5\",\"2\"]}' WHERE postID='942' Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'postTemplate' in 'field list' No ids to log. UPDATE perch2_blog_posts SET postStatus='Published', postTemplate='post.html', postDescRaw='A frooty session IPA', postDescHTML='<p>A frooty session <span class=\"caps\">IPA</span></p>', postTitle='AM:PM', postDateTime='2018-12-21 20:31:00', postDynamicFields='{\"abv\":\"4.5%\",\"brewery-name\":\"Thronbridge\",\"image\":{\"_default\":\"\/perch\/resources\/ampm.png\",\"path\":\"ampm.png\",\"size\":309184,\"bucket\":\"default\",\"w\":400,\"h\":500,\"sizes\":{\"thumb\":{\"w\":120,\"h\":150,\"path\":\"ampm-thumb.png\",\"size\":34126},\"w120h150c1\":{\"w\":120,\"h\":150,\"path\":\"ampm-w120h150.png\",\"size\":34126},\"w400h500c1\":{\"w\":400,\"h\":500,\"path\":\"ampm-w400h500.png\",\"size\":309184}}},\"brewery-desc\":{\"_flang\":\"textile\",\"raw\":\"\\"thornbridgebrewery.co.uk\\":https:\/\/thornbridgebrewery.co.uk\",\"processed\":\"<p><a href=\\"https:\/\/thornbridgebrewery.co.uk\\">thornbridgebrewery.co.uk<\/a><\/p>\"},\"categories\":[\"5\",\"2\"]}', postSlug='2018-12-21-ampm' WHERE postID='942' Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'postTemplate' in 'field list' No ids to log. DELETE FROM perch2_blog_index WHERE itemKey='postID' AND itemID='942' [4] SELECT * FROM perch2_blog_authors ORDER BY authorFamilyName, authorGivenName ASC [1] SELECT * FROM perch2_categories WHERE catID=5 LIMIT 1 [1] SELECT * FROM perch2_categories WHERE catID=2 LIMIT 1 INSERT INTO perch2_blog_index (itemKey, itemID, indexKey, indexValue) VALUES ('postID',942,'abv','4.5%'),('postID',942,'brewery-name','Thronbridge'),('postID',942,'image','/perch/resources/ampm.png'),('postID',942,'brewery-desc','thornbridgebrewery.co.uk'),('postID',942,'_category','blog/beer/'),('postID',942,'_category','blog/current/'),('postID',942,'postID','942'),('postID',942,'blogID','1'),('postID',942,'postTitle','AM:PM'),('postID',942,'postSlug','2018-12-21-ampm'),('postID',942,'postDateTime','2018-12-21 20:31:00'),('postID',942,'postDescRaw','A frooty session IPA'),('postID',942,'postDescHTML','<p>A frooty session <span class=\"caps\">IPA</span></p>'),('postID',942,'postTags',''),('postID',942,'postStatus','Published'),('postID',942,'authorID','4'),('postID',942,'sectionID','1'),('postID',942,'postCommentCount','0'),('postID',942,'postTemplate','post.html'),('postID',942,'itemID',''),('postID',942,'itemRowID',''),('postID',942,'authorGivenName','Rae'),('postID',942,'authorFamilyName','Williams'),('postID',942,'authorEmail','raester1966@gmail.com'),('postID',942,'authorPostCount','511'),('postID',942,'authorSlug','rae-williams'),('postID',942,'authorImportRef',''),('postID',942,'postURL','/blog/post.php?s=2018-12-21-ampm'),('postID',942,'postURLFull','https://localhost/blog/post.php?s=2018-12-21-ampm'),('postID',942,'_id',942) [1] OPTIMIZE TABLE perch2_blog_index [6] SELECT COUNT() AS qty, c.catID FROM perch2_blog_index i, perch2_categories c, perch2_blog_posts p WHERE i.indexValue=c.catPath AND i.indexKey='_category' AND i.itemKey='postID' AND i.itemID=p.postID AND p.postStatus='Published' AND p.postDateTime<='2019-01-02 09:46:00' GROUP BY i.indexValue, c.catID DELETE FROM perch2_category_counts WHERE countType='blog.post' [1] SELECT * FROM perch2_categories WHERE catID=5 LIMIT 1 DELETE FROM perch2_category_counts WHERE catID=5 AND countType='blog.post' INSERT INTO perch2_category_counts(countType,countValue,catID) VALUES('blog.post',17,'5') [1] SELECT * FROM perch2_categories WHERE catID=2 LIMIT 1 DELETE FROM perch2_category_counts WHERE catID=2 AND countType='blog.post' INSERT INTO perch2_category_counts(countType,countValue,catID) VALUES('blog.post',9,'2') [1] SELECT * FROM perch2_categories WHERE catID=3 LIMIT 1 DELETE FROM perch2_category_counts WHERE catID=3 AND countType='blog.post' INSERT INTO perch2_category_counts(countType,countValue,catID) VALUES('blog.post',3,'3') [1] SELECT * FROM perch2_categories WHERE catID=1 LIMIT 1 DELETE FROM perch2_category_counts WHERE catID=1 AND countType='blog.post' INSERT INTO perch2_category_counts(countType,countValue,catID) VALUES('blog.post',4,'1') [1] SELECT * FROM perch2_categories WHERE catID=6 LIMIT 1 DELETE FROM perch2_category_counts WHERE catID=6 AND countType='blog.post' INSERT INTO perch2_category_counts(countType,countValue,catID) VALUES('blog.post',12,'6') [1] SELECT * FROM perch2_categories WHERE catID=4 LIMIT 1 DELETE FROM perch2_category_counts WHERE catID=4 AND countType='blog.post' INSERT INTO perch2_category_counts(countType,countValue,catID) VALUES('blog.post',42,'4') [4] SELECT authorID, COUNT(*) AS qty FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2019-01-02 09:46:00' GROUP BY authorID UPDATE perch2_blog_authors SET authorPostCount=0 UPDATE perch2_blog_authors SET authorPostCount='261' WHERE authorID=1 LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='26' WHERE authorID=2 LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='111' WHERE authorID=3 LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='511' WHERE authorID=4 LIMIT 1 [1] SELECT c.sectionID, COUNT(p.postID) AS qty FROM perch2_blog_sections c, perch2_blog_posts p WHERE c.sectionID=p.sectionID AND p.postStatus='Published' AND p.postDateTime<='2019-01-02 09:46:00' GROUP BY c.sectionID ORDER BY c.sectionTitle ASC UPDATE perch2_blog_sections SET sectionPostCount=0 UPDATE perch2_blog_sections SET sectionPostCount='909' WHERE sectionID='1' LIMIT 1 Edit mode: edit [1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1 [4] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC [1] SELECT itemTitle FROM perch2_menu_items WHERE itemType='app' AND itemValue='perch_blog' LIMIT 1 [1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10 [2] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC File: \addons\apps\perch_blog\modes\edit.post.php [6] SELECT * FROM perch2_categories c, perch2_category_sets s WHERE c.setID=s.setID AND s.setSlug='blog' ORDER BY catTreePosition ASC [1] SELECT * FROM perch2_categories WHERE catID=5 LIMIT 1 [1] SELECT * FROM perch2_categories WHERE catID=2 LIMIT 1 Queries: 87 Memory: 8.8982

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try visiting /perch/addons/apps/perch_blog/update/ in your browser.

Yes, thanks, that seems to have fixed it. It's slightly odd as the update definitely ran the first time as I recall seeing the blog update count incrementing. There's quite a few posts so it took a minute or two.

Anyway all's well that...

Thanks again.

Cheers - Mark

If you turn on debug and save a post, do you get any errors displayed? https://mana.badi.co.in/

Was facing same problem on my site https://livenettvapk.co/ Thanks for the solution

Hotmail is free webmail service provided by Microsoft, basically this email design for corporate and professional use. Start hotmail login account now. https://hotmailwiki.com/hotmail-login