$entry.last_modified not avail when $view==search

Found a bug? Tell us!!
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

$entry.last_modified not avail when $view==search

Post by Don Chambers »

happened to catch an error in one of my logs... turns out that $entry.last_modified is not an available field in a quicksearch view.... this reminds me of this thread: http://board.s9y.org/viewtopic.php?t=12742

This is confirmed on a live site, my sandbox, and also by Judebert. Any ideas?
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I don't see any different SQL being called, so I can't figure out why $entry.last_modified isn't set. (Bump.)
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Hey Garvin - do you have any input on this issue?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
Don Chambers wrote:Hey Garvin - do you have any input on this issue?
Sadly not right now.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

I read elsewhere that an updated release may be necessary - perhaps this bugfix can make its way into that? BTW - this was 1.3.x branch.

I have a template that provides functionality based on that field, so right now, that functionality is broken on search results pages.
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Got it.

When searching, we call serendipity_searchEntries(). When just reading, we call the (much more complex and versatile) serendipity_fetchEntries().

Guess which one doesn't have the SQL for last_modified? :roll:

In fact, the basic SQL is not significantly different. I'm wondering if perhaps we should have searchEntries() call fetchEntries(), so they both fetch the same data. Garvin?

While checking the two queries to see how far they differed, I found that isdraft and loginname are also not included. However, body, extended, and the "moderate_comments" setting are added.

So, I just added e.isdraft, e.last_modified, and a.username AS loginname to the SQL that starts on line 776 of functions_entries.inc.php. For the 1.4/trunk branch, the query starts on line 781.

I tested it in my sandbox to make sure it works. Since this is a core file, it can't be downloaded from SPARTACUS. You can wait for the next nightly build (within 24 hours) or download the file directory from:
1.3 branches
http://svn.berlios.de/viewcvs/*checkout ... es.inc.php
trunk installations
http://svn.berlios.de/viewcvs/*checkout ... es.inc.php
...and copy it into your serendipity/include/ directory.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks a bunch Jude!!!! Works perfectly. Much appreciated! 8)
=Don=
Post Reply