Forum
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.
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( )
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
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
Do you have access to make changes in the database?
yes i do...
In the
perch2_settings
table, there should be a row where thesettingID
column has the valueperch_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
ADDpostImportID
VARCHAR(64) NULL DEFAULT NULL AFTERpostCommentCount
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postImportID' ALTER TABLEperch2_blog_posts
ADDpostCommentCount
INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTERauthorID
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postCommentCount' ALTER TABLEperch2_blog_posts
ADDpostLegacyURL
VARCHAR(255) NULL DEFAULT NULL AFTERpostImportID
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postLegacyURL' ALTER TABLEperch2_blog_posts
ADDpostAllowComments
TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' AFTERpostLegacyURL
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postAllowComments' ALTER TABLEperch2_blog_authors
ADDauthorImportRef
VARCHAR(64) NULL DEFAULT NULL AFTERauthorSlug
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'authorImportRef' INSERT INTOperch2_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 TABLEperch2_blog_categories
ADDcategoryPostCount
INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTERcategorySlug
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'categoryPostCount' ALTER TABLEperch2_blog_categories
ADDcategoryDynamicFields
TEXT NULL AFTERcategoryPostCount
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'categoryDynamicFields' ALTER TABLEperch2_blog_posts
ADDpostTemplate
VARCHAR(255) NOT NULL DEFAULT 'post.html' AFTERpostAllowComments
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'postTemplate' ALTER TABLEperch2_blog_authors
ADDauthorDynamicFields
TEXT NULL AFTERauthorImportRef
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'authorDynamicFields' ALTER TABLEperch2_blog_authors
ADDauthorPostCount
INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTERauthorEmail
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'authorPostCount' ALTER TABLEperch2_blog_posts
ADDsectionID
INT(10) UNSIGNED NOT NULL DEFAULT '1' AFTERauthorID
Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sectionID' ALTER TABLEperch2_blog_posts
ADD INDEXidx_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 TABLEperch2_blog_posts
ADD INDEXidx_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 TABLEperch2_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
), KEYidx_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 INTOperch2_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() AScount
SELECT COUNT() FROM perch2_blog_comments WHERE commentStatus='PENDING' Queries: 55Ok - 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 ;-)