Can't do anything with comments

2 views
Skip to first unread message

Florian Fiegel

unread,
Oct 22, 2008, 1:09:12 PM10/22/08
to habari-users
Hi out there,

I'm using actual Head (0.6alpha) and got the first comment on my Blog.
I wanted to approve it and went to the Admin-Panel to do so, but first
thing I noticed was that there is a error warning on it.

In the third column there is displayed the following:

Notice: Trying to get property of non-object in system/admin/
comments_items.php line 15

Notice: Trying to get property of non-object in system/admin/
comments_items.php line 15

http://schwarzes-gift.de/admin/comments?status=0" class="edit-date"
title="
Fatal error: Call to a member function format() on a non-object in /
var/.../html/system/admin/comments_items.php on line 15

When I select the entry and want to approve it nothing happens. I
don't know where it comes from, but maybe it is associated with the
error above. What can I now do? Is this error known?

regards
Florian

Arthus Erea

unread,
Oct 22, 2008, 1:11:44 PM10/22/08
to habari...@googlegroups.com
It looks like you might not be fully upgraded.

The format() method is being called on what is supposed to be an
instance of HabariDateTime. Unfortunately, something must be wrong
with the DateTime class on your installation.

My advice: first ensure you really are at HEAD and make sure your
timezone is set (in options). If you still have issues, your database
may be corrupted and will need manual intervention.

Florian Fiegel

unread,
Oct 22, 2008, 1:20:54 PM10/22/08
to habari-users
Time Zone is set, time and date format aren't set. Could it be that
the not set format causes the problem?

Hm, I just updated to the new Version of Head on Monday from last Head
and this was updated from a 0.5.1 cause I wanted to use DB Backup via
Mail ad this also uses the HabariDateTime
Did there changed anything on Database between the Versions?

I cleaned the full installation except .htaccess, config.php and user-
folder, so this must be Head.

When I have to make a manual intervention, what is to do?

regards
Florian

Arthus Erea

unread,
Oct 22, 2008, 1:23:24 PM10/22/08
to habari...@googlegroups.com
Well, the usual manual intervention is cleaning up stray timezone
options.

However, if other time functions are working fine, then that might not
be an issue.

A scary possibility is that your comment dates might not have been
properly updates. Hopefully someone with more DB experience can chime
in with better help. :)

Matt Read

unread,
Oct 22, 2008, 2:21:27 PM10/22/08
to habari...@googlegroups.com
using phpmyadmin open up your comments table and have a look at the
values for 'date' column. They should be long numbers (timestamps). If
they are empty or not numbers then something has gone wrong.

--
Matt Read
http://mattread.com

Ali B.

unread,
Oct 22, 2008, 2:28:00 PM10/22/08
to habari...@googlegroups.com
This error is often caused by an old theme. One that applies the nice_date format to comment date in its theme.php.

I can see however that you are using Charcoal. So it's either that the theme was not updated or you are using a customized one that you have put in /user/themes instead.

Eitherway, check for the following method call in the theme's theme.php, do you see any?

Format::apply('nice_date', blah);
--
Ali B / dmondark
http://www.awhitebox.com

Florian Fiegel

unread,
Oct 22, 2008, 3:01:58 PM10/22/08
to habari-users
Oh, okay the Theme was modified on the Theme in 0.5.1


So, how can I fix it? Will it last to overwrite theme.php with the new
one or are there more changes to make? I didn't changed much, so it
should be no problem to transfer it to the new template, but for
future it would be helpful to know …

I found the following ones in the Theme.php:

Format::apply( 'nice_date', 'post_pubdate_out', 'F j, Y g:ia' );
// Apply Format::nice_date() to comment date...
Format::apply( 'nice_date', 'comment_date', 'F j, Y g:ia' );

In the Comments-Table the date is set as a timestamp and type int(10).
So it seems to be the old Theme.

Tried it with the new charcoal and it worked all like it should …

Thanks a lot for your help …
Florian

Ali B.

unread,
Oct 22, 2008, 3:18:12 PM10/22/08
to habari...@googlegroups.com
I recommend using the new system charcoal if you haven't made much changes. But here's how to fix it for the old theme:

What you need to do is to first remove *both* of these Fomrat:apply calls from your theme.php. This would leave you with the theme printing the times in epoc. So to fix that, you need go through all of the theme's template files and change:

$post->pubdate_out     to     $post->pubdate->out('F j, Y g:ia')
$post->pubdate           to     $post->pubdate->get('F j, Y g:ia')
$comment->date         to     $comment->date->get('F j, Y g:ia')

Of course, you can change the date format (F j, Y g:ia) to whatever format you  want
Reply all
Reply to author
Forward
0 new messages