Forum
Blog Error
I’m receiving the following error when trying to save a new blog post. How do I fix this?
Fatal error: Cannot redeclare class HIDDEN\Textile\Tag in /home1/HIDDEN/public_html/perch/core/lib/Textile.class.php on line 4204
Here is the short diagnostic report:
SUMMARY INFORMATION
Perch: 2.7.5, PHP: 5.4.38, MySQL: 5.5.42-37.1, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (2.7.5), assets (2.7.5), categories (2.7.5), perch_forms (1.5.1), perch_blog (3.8.1), perch_backup (1.2) App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /home1/hidden/public_html/perch PERCH_CORE: /home1/hidden/public_html/perch/core PERCH_RESFILEPATH: /home1/hidden/public_html/perch/resources Image manipulation: GD Imagick PHP limits: Max upload 64M, Max POST 64M, Memory: 256M, Total max file upload: 64M Resource folder writeable: Yes DOCUMENT_ROOT: /home1/hidden/public_html HTTP_HOST: hidden REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
You need to update to a more recent version of both Perch and the Blog app.
That's what I thought, but I wanted to confirm before going through the steps.
I upgraded both Perch and the Blog app to the latest version, but I'm experiencing a strange issue. If I create a new post and try to publish it doesn't show up in the post list, but if I first save the new post as a draft and then change this to publish and save again it shows up in the post list.
Any ideas of why this would be happening?
Did you update your blog templates as described in the docs? https://docs.grabaperch.com/addons/blog/installation/
It appears I updated everything correctly. I'm not using categories, but do these need to be installed for the blog app to work correctly?
I don't think so, no.
If you turn debug on, do you get any errors when you create the blog post?
No errors in debug, but I think I figured out the issue. I have the following in my template:
<perch:blog id="authorN" type="text" label="Author" required="false" />
If I leave this field blank it doesn't show up in the list, but if I include something in this field it does show up.
The same field in included in my post_in_list.html
Actually there might be some debug errors. Do you get anything from this?
Debug Message 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='93872ff555756267d28c7a05cebf34e3' LIMIT 1 UPDATE perch2_users SET userHash='1127657a187cd3ffcc95bb5762ace849' WHERE userID='1' SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID SELECT * FROM perch2_blog_authors WHERE authorEmail='hidden' LIMIT 1 SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC SELECT * FROM perch2_blog_posts WHERE postID=14 SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC Using template: /addons/apps/perch_blog/templates/blog/post.html Dynamic fields: Array ( [postTitle] => adsf [image] => [postDescHTML] => Array ( [raw] => asdf [processed] => asdf
) UPDATE perch2_blog_posts SET postTags='', postStatus='Published', postAllowComments='1', postTemplate='post.html', authorID='1', postDescRaw='asdf', postDescHTML='<p>asdf</p>', postTitle='adsf', postDynamicFields='{\"image\":null,\"authorN\":\"adsf\",\"excerpt\":{\"raw\":\"\",\"processed\":\"\"}}' WHERE postID='14' No ids to log. UPDATE perch2_blog_posts SET postTags='', postStatus='Published', postAllowComments='1', postTemplate='post.html', authorID='1', postDescRaw='asdf', postDescHTML='<p>asdf</p>', postTitle='adsf', postDynamicFields='{\"image\":null,\"authorN\":\"adsf\",\"excerpt\":{\"raw\":\"\",\"processed\":\"\"}}', postSlug='1969-12-31-adsf' WHERE postID='14' No ids to log. DELETE FROM perch2_blog_posts_to_tags WHERE postID='14' DELETE FROM perch2_blog_index WHERE itemKey='postID' AND itemID='14' SELECT * FROM perch2_blog_authors ORDER BY authorFamilyName, authorGivenName ASC INSERT INTO perch2_blog_index (itemKey, itemID, indexKey, indexValue) VALUES ('postID',14,'image',''),('postID',14,'authorN','adsf'),('postID',14,'excerpt',''),('postID',14,'postID','14'),('postID',14,'postTitle','adsf'),('postID',14,'postSlug','1969-12-31-adsf'),('postID',14,'postDateTime','2015-06-24 13:11:42'),('postID',14,'postDescRaw','asdf'),('postID',14,'postDescHTML','<p>asdf</p>'),('postID',14,'postTags',''),('postID',14,'postStatus','Published'),('postID',14,'authorID','1'),('postID',14,'sectionID','1'),('postID',14,'postCommentCount','0'),('postID',14,'postImportID',''),('postID',14,'postLegacyURL',''),('postID',14,'postAllowComments','1'),('postID',14,'postTemplate','post.html'),('postID',14,'itemID',''),('postID',14,'itemRowID',''),('postID',14,'authorGivenName','Ryan'),('postID',14,'authorFamilyName','hidden'),('postID',14,'authorEmail','hidden'),('postID',14,'authorPostCount','1'),('postID',14,'authorSlug','hidden'),('postID',14,'authorImportRef',''),('postID',14,'postURL','/blog/post.php?s=1969-12-31-adsf'),('postID',14,'_id',14) OPTIMIZE TABLE perch2_blog_index 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<='2015-06-24 13:12:00' GROUP BY i.indexValue DELETE FROM perch2_category_counts WHERE countType='blog.post' SELECT authorID, COUNT(*) AS qty FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2015-06-24 13:12:00' GROUP BY authorID UPDATE perch2_blog_authors SET authorPostCount=0 UPDATE perch2_blog_authors SET authorPostCount='2' WHERE authorID=0 LIMIT 1 UPDATE perch2_blog_authors SET authorPostCount='2' WHERE authorID=1 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<='2015-06-24 13:12:00' GROUP BY c.sectionID ORDER BY c.sectionTitle ASC UPDATE perch2_blog_sections SET sectionPostCount=0 UPDATE perch2_blog_sections SET sectionPostCount='4' 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: 37 Memory: 4.5832 Array ( [type] => 8 [message] => Undefined index: postDateTime [file] => /home1/hidden/public_html/perch/addons/apps/perch_blog/PerchBlog_Post.class.php [line] => 84 )
Ah, ok, remove that tag from your
post.html
or set it totype="hidden"
That tag is still being used, it's just now required. How should I configure it so it works?
What do you mean by used and required?
I have a field that allows posters to manually enter an authors name versus selecting one from the drop down list.
<perch:blog id="authorN" type="text" label="Author" required="false" /> is placed between <h4></h4> tags.
I think it might be a cache issue. I just left this field blank and published. It didn't show up in the list on my current browser. I pulled up the list on a different browser and it was showing up fine.
Can you test removing the author tags?
Just to confirm, when you say remove the "author" tags do you want me to completely remove <perch:blog id="authorN" type="text" label="Author" required="false" /> or just the label="Author?
The entire tag, not just the label attribute. Any of the tags that refer to the author of the post.
I removed it completely, but my test post still didn't immediately appear in the list in Chrome. When pulled the page up in Safari it was there.
After clearing my cache in Chrome it appeared.
Ok, so does that resolve the issue?