Keywords plugin sez: undefined index
Posted: 14 July 2005 06:46 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

When I use the Keywords plugin tag {exp:keywords:entries} it throws the following:

Notice: Undefined index: comment_expiration_date in /home/lincol7/public_html/core/modules/weblog/mod.weblog.php on line 1855


Line 1855 is:

if (($row['comment_expiration_date'] > 0 && $LOC->now > $row['comment_expiration_date']) OR $row['allow_comments'] == 'n')


I have the following comment-related code inside the Keywords tags: (simplified for easier reading)

{if allow_comments}
  {if comment_total
== "0"}No Comments{/if}
  {if comment_total
== "1"}1 Comment{/if}
  {if comment_total
> "1"}{comment_total} Comments{/if}
{
/if}
{if allow_comments
== "n"}Comments are closed{/if}


The same code within an {exp:weblog:entries} tag does not create any errors.

What is the problem? Is anybody else seeing this? What can I do to fix it?

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 14 July 2005 06:54 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

Why would you have that code INSIDE the keywords plugin?  That’s why you’re getting the errors.

 Signature 
Profile
MSG
 
 
Posted: 14 July 2005 07:04 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

Why not? It works just like it does in {exp:weblog:entries}. Almost. Except for that pesky little notice.

The error disappears if there is at least one comment on the entry.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 14 July 2005 07:06 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

Because the plugin doesn’t have those tags, and so it’s going to throw errors trying to parse them.

The question is: why would you put them inside the keywords plugin?  It doesn’t make any sense…. =)

 Signature 
Profile
MSG
 
 
Posted: 14 July 2005 07:30 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

What doesn’t make sense?

{exp:keywords:entries weblog="news" keyword="{segment_3}" keyword_fields="news_tags"}
  
<h3>{title}</h3>
  
{body}
  
<p>
    
{entry_date format="%j %F %Y at %g:%i%a"} |
    
{author} |
    <
a href="http://someurl.com/something/somewhere/#comments">
    
{if allow_comments}
      {if comment_total
== "0"}
        No Comments
        {
/if}
      {if comment_total
== "1"}
        1 Comment
      {
/if}
      {if comment_total
> "1"}
        {comment_total} Comments
      {
/if}
    {
/if}
    
</a>
    
{if allow_comments == "n"}
      Comments are closed
    {
/if}
  
</p>
{/exp:keywords:entries}


Which says: Show posts from the News weblog that are related by keywords, which can be found in the “news_tags” field. For each post, show the title, the body, and some additional useful information. That information includes the date and time of the post, the author of the post, and whether or not any comments have been made to the post.

That strikes me as pretty straight-forward. Should I be doing what I’m doing differently? Like I said, it works just fine except when {comment_total} equals 0.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 14 July 2005 07:34 PM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

It doesn’t make sense because um…

How about you insert a funny excuse here?

*takes mouth out of foot*

I am not sure, then why it’s happening.  I’ll test it when I go home tonight, or tomorrow.

Sorry :(  I’ll see if I can replicate the error. =)

 Signature 
Profile
MSG
 
 
Posted: 14 July 2005 07:41 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

Well blow me down. I seem to have fixed it. Or maybe I should say “fixed” it, since I’m no PHP guru and I may have inadvertantly screwed something else up. I changed line 987 of pi.keywords.php to:

... exp_weblog_titles.allow_comments, [b]exp_weblog_titles.comment_expiration_date, [/b]exp_weblog_titles.allow_trackbacks, ...


which matches line 1472 of mod.weblog.php. No more error, full functionality.

Mr. Wilson’s conclusion: the Keywords plugin needs some minor updates for EE1.3.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 14 July 2005 08:00 PM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

Ah ha, then I don’t have to try to replicate it?  Excellent.

Glad you figured it out. I"m not surprised it needs updating.. You might want to contact Andy (the plugin author) about it.

 Signature 
Profile
MSG
 
 
Posted: 14 July 2005 08:06 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

Will do. I’m sure there are other spots that need updating as well.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66466 Total Logged-in Users: 31
Total Topics: 84857 Total Anonymous Users: 13
Total Replies: 455321 Total Guests: 159
Total Posts: 540178    
Members ( View Memberlist )