Page 1 of 1
$entry.last_modified not avail when $view==search
Posted: Sat Jul 19, 2008 6:30 am
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?
Posted: Mon Jul 21, 2008 5:49 pm
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.)
Posted: Tue Jul 22, 2008 3:41 pm
by Don Chambers
Hey Garvin - do you have any input on this issue?
Posted: Tue Jul 22, 2008 3:45 pm
by garvinhicking
Hi!
Don Chambers wrote:Hey Garvin - do you have any input on this issue?
Sadly not right now.
Regards,
Garvin
Posted: Tue Jul 22, 2008 3:49 pm
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.
Posted: Tue Jul 22, 2008 9:38 pm
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?
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.
Posted: Wed Jul 23, 2008 4:13 pm
by Don Chambers
Thanks a bunch Jude!!!! Works perfectly. Much appreciated!
