Forum

Thread tagged as: Problem, Error, Blog

Perch blog - create post issue - "Sorry, that post could not be updated."

Hello, I just upgraded from 2.x (2.2.x?) to the latest 2,.5.4 along with latest blog, events and gallery app and now I'm getting 'Sorry, that post could not be updated.' when I try to add a post. This is at the staging post version. At the live version i can still add posts as normal.

If i use the live version to add the post, I then try to change it at the staging post, it behaves as though it has changed OK, success message etc but upon refresh it hasn't actually saved the changed.

Is there anything obvious that I should check or do?

Thanks.

mark buckley

mark buckley 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Have you updated your blog templates as explained here?

https://docs.grabaperch.com/docs/blog/installation/

Thanks - I don't think it's that though.

First I copied my post.html template from my previous project form last week, no problems on that one.

I also have just temporarily deleted the post.html in ,my templates folder at the staging post to force it to revert to the system default and the problem persists.

Not at the staging post but locally also getting the following:

( ! ) Notice: Undefined variable: i in C:\wamp\www\markdev\ttt\ttt-live\perch\core\lib\api\PerchAPI_Form.class.php on line 459 Call Stack

Time Memory Function Location

1 0.0005 271824 {main}( ) ..\index.php:0 2 0.0468 2386144 include( 'C:\wamp\www\markdev\ttt\ttt-live\perch\addons\apps\perch_blog\modes\edit.pre.php' ) ..\index.php:28 3 0.0619 4127408 PerchAPI_Form->receive_from_template_fields( )

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn debug on and let me know what it outputs when you get the error?

There seems to be an invalid query about 12 lines down...

DIAGNOSTICS: SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled='1' AND u.userID=8 AND u.userHash='0c9a529f726c7b8fc4754879bb218dc0' LIMIT 1 UPDATE perch2_users SET userHash='c7d7a63e0470e95f4c917202b3a48ab7' WHERE userID=8 SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=8 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='mark.buckley@dtew.co.uk' LIMIT 1 SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC Using template: /templates/blog/post.html INSERT INTO perch2_blog_posts(postTags,postStatus,postTemplate,authorID,postAllowComments,postDescRaw,postDescHTML,postTitle,postDateTime,postDynamicFields,postSlug) VALUES('','Published','post.html','6','0','uhygvlhijuv',' uhygvlhijuv ','tester99','2014-08-12 08:17:00','{\"excerpt\":{\"raw\":\"lhjuiv\",\"processed\":\" lhjuiv<\/p>\"}}','2014-08-12-tester99') Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'postTemplate' in 'field list' SELECT c.categoryID, COUNT(p2c.postID) AS qty FROM perch2_blog_categories c, perch2_blog_posts_to_categories p2c, perch2_blog_posts p WHERE p2c.categoryID=c.categoryID AND p2c.postID=p.postID AND p.postStatus='Published' AND p.postDateTime<='2014-08-12 08:18:00' GROUP BY c.categoryID ORDER BY c.categoryTitle ASC UPDATE perch2_blog_categories SET categoryPostCount=0 UPDATE perch2_blog_categories SET categoryPostCount='47' WHERE categoryID='2' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='2' WHERE categoryID='6' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='42' WHERE categoryID='4' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='78' WHERE categoryID='5' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='45' WHERE categoryID='3' LIMIT 1 SELECT authorID, COUNT() AS qty FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2014-08-12 08:18:00' GROUP BY authorID UPDATE perch2_blog_authors SET authorPostCount=0 UPDATE perch2_blog_authors SET authorPostCount='8' WHERE authorID='1' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='9' WHERE authorID='2' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='78' WHERE authorID='3' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='29' WHERE authorID='4' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='18' WHERE authorID='5' LIMIT 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<='2014-08-12 08:18:00' GROUP BY c.sectionID ORDER BY c.sectionTitle ASC UPDATE perch2_blog_sections SET sectionPostCount=0 UPDATE perch2_blog_sections SET sectionPostCount='142' WHERE sectionID='1' LIMIT 1 SELECT COUNT() FROM perch2_blog_comments WHERE commentStatus='PENDING' SELECT * FROM perch2_blog_authors ORDER BY authorFamilyName, authorGivenName ASC Queries: 41

Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like the Blog update hasn't run. Did you get any errors when that happened?

I got something that appeared to be similar to one that I'd had before, granted 'drop' access to the user and it seemed OK.

What do you think the best way to run the install is? hould I uninstall /reinstall blog? Is there any risk to existing posts?

thanks

Sorry to repost, what do you think the best way to get my blog reworking is?

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have access to make changes in the database?

yes i do...

Drew McLellan

Drew McLellan 2638 points
Perch Support

In the perch2_settings table, there should be a row where the settingID column has the value perch_blog_update

Delete that row, and that will cause Blog to believe that the latest update hasn't run.

If you then view the main post listing in the Blog app, the update should re-run. If you keep debug turned on, you'll see some errors. Some of these are fine (trying to do things that have already been done) but keep a copy as some may not been good.

Hope it means more to you than me...

DIAGNOSTICS: SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled='1' AND u.userID=8 AND u.userHash='c2282f9bbdb36c2bcf20a89f22f057a2' LIMIT 1 UPDATE perch2_users SET userHash='14f5d52e671b551b820ac6d06481e0cd' WHERE userID=8 SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=8 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.post.create' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.post.delete' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.post.publish' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.comments.moderate' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.comments.enable' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.categories.manage' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.import' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.authors.manage' LIMIT 1 SELECT * FROM perch2_user_privileges WHERE privKey='perch_blog.sections.manage' LIMIT 1 ALTER TABLE perch2_blog_posts ADD postImportID VARCHAR(64) NULL DEFAULT NULL AFTER postCommentCount Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postImportID' ALTER TABLE perch2_blog_posts ADD postCommentCount INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER authorID Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postCommentCount' ALTER TABLE perch2_blog_posts ADD postLegacyURL VARCHAR(255) NULL DEFAULT NULL AFTER postImportID Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postLegacyURL' ALTER TABLE perch2_blog_posts ADD postAllowComments TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' AFTER postLegacyURL Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postAllowComments' ALTER TABLE perch2_blog_authors ADD authorImportRef VARCHAR(64) NULL DEFAULT NULL AFTER authorSlug Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'authorImportRef' INSERT INTO perch2_settings (settingID, userID, settingValue) VALUES ('perch_blog_post_url', 0, '/blog/post.php?s={postSlug}') Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'perch_blog_post_url-0' for key 'PRIMARY' ALTER TABLE perch2_blog_categories ADD categoryPostCount INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER categorySlug Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'categoryPostCount' ALTER TABLE perch2_blog_categories ADD categoryDynamicFields TEXT NULL AFTER categoryPostCount Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'categoryDynamicFields' ALTER TABLE perch2_blog_posts ADD postTemplate VARCHAR(255) NOT NULL DEFAULT 'post.html' AFTER postAllowComments Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postTemplate' ALTER TABLE perch2_blog_authors ADD authorDynamicFields TEXT NULL AFTER authorImportRef Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'authorDynamicFields' ALTER TABLE perch2_blog_authors ADD authorPostCount INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER authorEmail Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'authorPostCount' ALTER TABLE perch2_blog_posts ADD sectionID INT(10) UNSIGNED NOT NULL DEFAULT '1' AFTER authorID Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sectionID' ALTER TABLE perch2_blog_posts ADD INDEX idx_status (postStatus)Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ALTER TABLE perch2_blog_posts ADD INDEX idx_section (sectionID)Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 CREATE TABLE perch2_blog_sections ( sectionID int(11) NOT NULL AUTO_INCREMENT, sectionTitle varchar(255) NOT NULL DEFAULT '', sectionSlug varchar(255) NOT NULL DEFAULT '', sectionPostCount int(10) unsigned NOT NULL DEFAULT '0', sectionDynamicFields text, PRIMARY KEY (sectionID), KEY idx_slug (sectionSlug) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC Invalid query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'perch2_blog_sections' already exists INSERT INTO perch2_blog_sections (sectionID, sectionTitle, sectionSlug, sectionPostCount, sectionDynamicFields) VALUES ('1', 'Posts', 'posts', 0, '') Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' 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<='2014-08-13 14:54:00' GROUP BY c.sectionID ORDER BY c.sectionTitle ASC UPDATE perch2_blog_sections SET sectionPostCount=0 UPDATE perch2_blog_sections SET sectionPostCount='142' WHERE sectionID='1' LIMIT 1 SELECT c.categoryID, COUNT(p2c.postID) AS qty FROM perch2_blog_categories c, perch2_blog_posts_to_categories p2c, perch2_blog_posts p WHERE p2c.categoryID=c.categoryID AND p2c.postID=p.postID AND p.postStatus='Published' AND p.postDateTime<='2014-08-13 14:54:00' GROUP BY c.categoryID ORDER BY c.categoryTitle ASC UPDATE perch2_blog_categories SET categoryPostCount=0 UPDATE perch2_blog_categories SET categoryPostCount='47' WHERE categoryID='2' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='2' WHERE categoryID='6' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='42' WHERE categoryID='4' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='78' WHERE categoryID='5' LIMIT 1 UPDATE perch2_blog_categories SET categoryPostCount='45' WHERE categoryID='3' LIMIT 1 SELECT authorID, COUNT() AS qty FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2014-08-13 14:54:00' GROUP BY authorID UPDATE perch2_blog_authors SET authorPostCount=0 UPDATE perch2_blog_authors SET authorPostCount='8' WHERE authorID='1' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='9' WHERE authorID='2' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='78' WHERE authorID='3' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='29' WHERE authorID='4' LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='18' WHERE authorID='5' LIMIT 1 DELETE FROM perch2_settings WHERE settingID='perch_blog_update' AND userID=0 LIMIT 1 INSERT INTO perch2_settings(settingID,settingValue,userID) VALUES('perch_blog_update','4.0',0) SELECT * FROM perch2_blog_categories ORDER BY categoryTitle ASC SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_blog_posts ORDER BY postDateTime DESC LIMIT 0, 15 SELECT FOUND_ROWS() AS count SELECT COUNT() FROM perch2_blog_comments WHERE commentStatus='PENDING' Queries: 55

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok - any difference?

Duh! Yes it seems fine now, many thanks.

I had assumed that because there were 'errors' in the code above that there was still a problem and hadn't retried it but all seems fine now.

Thanks again.

hey!

good thing: this helped me out with the same error, too.

thanks forum and drew ;-)