Forum

Thread tagged as: Problem, Error, Blog

Perch Blog is giving an "Undefined index: postDateTime" error

Recently, while creating a temple for my new Perch Blog, I've been getting this error:

Notice: Undefined index: postDateTime in....\perch\addons\apps\perch_blog\PerchBlog_Post.class.php on line 92

The editor does not seem to recognize any changes I make to the template, although they are reflected in the blog itself when I refresh the page. How do I go about solving this?

Perch Template

<div class="tile-content v-spacing-sm col-xs-12">

  <div class="col-xs-12 blog_post_head">
      <div class="col-xs-1 text-center blog_post_big_date">
          <h3><perch:blog id="postDateTime" format="d" /></h3>
          <p><perch:blog id="postDateTime" format="M" /></p>
      </div>

      <div class="col-xs-10 blog_post_body_head">
          <h3 class="entry-title">
            <perch:blog id="postTitle" label="Post Title" />
          </h3>
          <span>Tags: <perch:blog id="postTags" label="Post Tags" /></span>
          <hr>
      </div>
  </div><!--Close blog_post_head-->

  <div class="col-xs-12 blog_post_content">
    <div class="col-xs-10 col-xs-offset-1 blog_post_body">

      <div>
        <img src="<perch:blog id="cover_img" type="image label="Cover Image" />" class="width_full" />
      </div>

      <hr>

      <div class="post_published_date">
        <p>Published: <perch:blog id="postDateTime" format="M d Y" /> @ <perch:blog id="postDateTime" format="H:i" /></p>
      </div>

      <div class="post_text">
        <perch:blog id="body" type="textarea" label="Post Body" editor="redactor" html="true" size="xl" />
      </div>

    </div><!--Close blog_post_body-->


    <div class="col-xs-10 col-xs-offset-1 v_spacing_sm blog_post_foot">

      <div class="float_left">
        <a href="#"><img src="images/pe_icon_sm_facebook.png" class="post_inline_socialmedia" /></a>
        <a href="#"><img src="images/pe_icon_sm_googleplus.png" class="post_inline_socialmedia" /></a>
        <a href="#"><img src="images/pe_icon_sm_twitter.png" class="post_inline_socialmedia" /></a>
        <a href="#"><img src="images/pe_icon_sm_email.png" class="post_inline_socialmedia" /></a>
      </div>

      <div class="col-xs-4 float_right">
        <a href="#list_to_post">
          <button class="btn btn-default btn-warning btn-block">Read More...</button>
        </a>
      </div>

    </div><!--Close blog_post_foot-->


  </div><!--Close blog_post_content-->

</div>

DIAGNOSTICS:

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='385b3fb40922abc4164d33a31122c09b'
LIMIT 1
UPDATE perch2_users SET userHash='6ed1025007772c64ecb0b14be12c1886' WHERE userID=1
SELECT p.privKey FROM perch2_users u, perch2_user_role_privileges rp, perch2_user_privileges p
WHERE u.roleID=rp.roleID AND rp.privID=p.privID AND u.userID=1
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_categories ORDER BY categoryTitle ASC
SELECT * FROM perch2_blog_authors WHERE authorEmail='mjb28@njit.edu' LIMIT 1
SELECT * 
FROM perch2_blog_sections ORDER BY sectionTitle ASC
SELECT * FROM perch2_blog_posts WHERE postID=1
SELECT categoryID FROM perch2_blog_posts_to_categories WHERE postID = 1
Using template: \templates\blog\post.html
Array
(
    [postTags] => birds, dogs, peckers
    [postTemplate] => post.html
    [authorID] => 2
    [postStatus] => Published
    [postID] => 1
    [btnSubmit] => Save
    [formaction] => perch_blog
    [token] => 9097ec14f102574889a0052945c2e733
)


Array
(
)


Array
(
    [postTags] => birds, dogs, peckers
    [postStatus] => Published
    [postTemplate] => post.html
    [authorID] => 2
    [postAllowComments] => 0
    [postDynamicFields] => []
    [postTitle] => Post 1
)


UPDATE perch2_blog_posts SET postTags='birds, dogs, peckers', postStatus='Published', postTemplate='post.html', authorID='2', postAllowComments='0', postDynamicFields='[]', postTitle='Post 1' WHERE postID=1
UPDATE perch2_blog_posts SET postTags='birds, dogs, peckers', postStatus='Published', postTemplate='post.html', authorID='2', postAllowComments='0', postDynamicFields='[]', postTitle='Post 1', postSlug='1970-01-01-post-1' WHERE postID=1
DELETE FROM perch2_blog_posts_to_categories WHERE postID='1'
DELETE FROM perch2_blog_posts_to_tags WHERE postID='1'
SELECT tagID, tagTitle FROM perch2_blog_tags WHERE tagTitle = 'birds' LIMIT 1
INSERT INTO perch2_blog_posts_to_tags(postID,tagID) VALUES('1','1')
SELECT tagID, tagTitle FROM perch2_blog_tags WHERE tagTitle = 'dogs' LIMIT 1
INSERT INTO perch2_blog_posts_to_tags(postID,tagID) VALUES('1','2')
SELECT tagID, tagTitle FROM perch2_blog_tags WHERE tagTitle = 'peckers' LIMIT 1
INSERT INTO perch2_blog_posts_to_tags(postID,tagID) VALUES('1','3')
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-06-24 13:20:00' 
GROUP BY c.categoryID
ORDER BY c.categoryTitle ASC
SELECT authorID, COUNT(*) AS qty
FROM perch2_blog_posts 
WHERE postStatus='Published' AND postDateTime<='2014-06-24 13:20:00' 
GROUP BY authorID
UPDATE perch2_blog_authors SET authorPostCount=0
UPDATE perch2_blog_authors SET authorPostCount='1' WHERE authorID='1' LIMIT 1
UPDATE perch2_blog_authors SET authorPostCount='1' WHERE authorID='2' 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-06-24 13:20:00' 
GROUP BY c.sectionID
ORDER BY c.sectionTitle ASC
UPDATE perch2_blog_sections SET sectionPostCount=0
UPDATE perch2_blog_sections SET sectionPostCount='2' 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: 42
Array
(
    [type] => 8
    [message] => Undefined index: postDateTime
    [file] => C:\wamp\www\ll\leewardtwo\web\perch\addons\apps\perch_blog\PerchBlog_Post.class.php
    [line] => 92
)






PERCH INFORMATION

Perch: 2.4.9
Production mode: Production (100)
Installed apps: content (2.4.9), perch_mailchimp (2.0.1), perch_blog (4.0.3)
DB driver: PDO
DB tables: chat_logs, designer_floorplans, designer_floorplans_rooms, designer_items, designer_items_options, designer_options, designer_roomoptions, designer_rooms, designer_rooms_items, document_files, document_folders, perch2_blog_authors, perch2_blog_categories, perch2_blog_comments, perch2_blog_posts, perch2_blog_posts_to_categories, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_content_resources, perch2_mailchimp_campaigns, perch2_mailchimp_history, perch2_mailchimp_log, perch2_mailchimp_stats, perch2_mailchimp_subscribers, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resources, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users, photo_albums, photo_images, punchlist_categories, punchlist_dependencies, punchlist_entries, punchlist_items, roles, tasks, timetrack_categories, timetrack_entries, timetrack_tasks, user_choices, user_designs, users, users_roles
Users: 3
App runtimes:
<?php
    include(PERCH_PATH.'/core/apps/content/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_mailchimp/runtime.php');
?>
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for perch_mailchimp: update_list_stats (60 mins)
Editor plug-ins: markitup, redactor
H1: 421aa90e079fa326b6494f812ad13e79
L1: 60819fd8683469ce7fc6e95de3fad8e9
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.4.9: done
latest_version: 2.3.2
on_sale_version: 2.4.9
perch_blog_post_url: /blog/post.php?s={postSlug}
perch_blog_update: 4.0
headerScheme: light
content_hideNonEditableRegions: 1
content_frontend_edit: 1
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
dashboard: 0
hide_pwd_reset: 0
perch_blog_comment_notify: 0
perch_mailchimp_secret: 543e5ee6340c972bf6d7f11381eff6d1
perch_mailchimp_update: 2.0
perch_mailchimp_api_key: ec2903384d8dff9758623bdbb48f4db2-us8
perch_mailchimp_list_id: d42b804d21
perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: leewardone
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: leewardone
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: mjb28@njit.edu
PERCH_EMAIL_FROM_NAME: Matthew Breau
PERCH_LOGINPATH: /ll/leewardtwo/web/perch
PERCH_PATH: C:\wamp\www\ll\leewardtwo\web\perch
PERCH_CORE: C:\wamp\www\ll\leewardtwo\web\perch\core
PERCH_RESFILEPATH: C:\wamp\www\ll\leewardtwo\web\perch\resources
PERCH_RESPATH: /ll/leewardtwo/web/perch/resources
PERCH_HTML5: 1
PERCH_EMAIL_METHOD: smtp
PERCH_EMAIL_HOST: smtpout.secureserver.net
PERCH_EMAIL_AUTH:
PERCH_DEBUG: 1
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_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: C:\wamp\www\ll\leewardtwo\web\perch\templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.12
Zend: 2.4.0
OS: WINNT
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
MySQL server: 5.6.12-log
Extensions: Core, bcmath, calendar, com_dotnet, ctype, date, ereg, filter, ftp, hash, iconv, json, mcrypt, SPL, odbc, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, openssl, SimpleXML, wddx, xml, xmlreader, xmlwriter, apache2handler, gd, mbstring, mysql, mysqli, Phar, pdo_mysql, pdo_sqlite, mhash, xdebug
GD: Yes
ImageMagick: No
PHP max upload size: 2M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 2M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
HTTP_HOST: localhost
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
HTTP_REFERER: https://localhost/ll/leewardtwo/web/perch/core/settings/
HTTP_ACCEPT_ENCODING: gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6
HTTP_COOKIE: cmsa=1; _ga=GA1.1.1319817291.1402873230; PHPSESSID=fp20kkvccbb0hv267lt1lnhjj0; cmssb=1
PATH: C:\Program Files (x86)\ActiveState Komodo Edit 8\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;
SystemRoot: C:\Windows
COMSPEC: C:\Windows\system32\cmd.exe
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR: C:\Windows
SERVER_SOFTWARE: Apache/2.4.4 (Win64) PHP/5.4.12
SERVER_NAME: localhost
SERVER_ADDR: ::1
SERVER_PORT: 80
REMOTE_ADDR: ::1
DOCUMENT_ROOT: C:/wamp/www/
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: C:/wamp/www/
SERVER_ADMIN: admin@example.com
SCRIPT_FILENAME: C:/wamp/www/ll/leewardtwo/web/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 60789
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
REQUEST_URI: /ll/leewardtwo/web/perch/core/settings/diagnostics/
SCRIPT_NAME: /ll/leewardtwo/web/perch/core/settings/diagnostics/index.php
PHP_SELF: /ll/leewardtwo/web/perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1403616120.297
REQUEST_TIME: 1403616120
Matthew Breau

Matthew Breau 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like you're missing the type attribute from your date field, e.g.

<perch:blog id="postDateTime" type="date" label="Publish on" format="d" />

I corrected the instances of postDateTime, but the error did not go away.. To be sure, I removed all instances of it, and the error still appears when I save a post. Also the

<perch:blog id="body" type="textarea" label="Post Body" editor="redactor" html="true" size="xl" />

Is still not showing up..

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the default post.html work?

I'm not sure, for this project I'm using an MVC framework, and haven't configured the controller for an individual post yet..

However, I used the code from post.html to replace the code in post_in_list.html and it works properly, obviously not formatted correctly, but no errors. So I guess I'll just rebuild my "post_in_list" format, and check it every few steps to pinpoint the problem?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds like a good way forward.