Modify

Opened 7 years ago

Closed 2 years ago

Last modified 2 years ago

#3000 closed defect (fixed)

Search fails when the Wiki _and_ Doxygen has results for a keyword

Reported by: mgerth@… Owned by: cboos
Priority: normal Component: DoxygenPlugin
Severity: normal Keywords: doxygen search datetime
Cc: Trac Release: 0.11

Description

The problem is a "datetime.datetime <-> int comparision error" because:

  1. The default date-format of the ISearchSource is datetime
  1. DoxygenPlugin returns the filedate (ctime) as int.
  1. Trac compares both time-types to sort them, but fails because type datetime can not be compared with type int.

Here are the patch instructions for doxygentrac.py using the trac function to_datetime:

...
from trac.util.datefmt import to_timestamp, to_datetime, utc
...
def get_search_results(self, req, keywords, filters):
...
      if os.path.isdir(path):
                index = os.path.join(path, 'search.idx')
                if os.path.exists(index):
>>>>                creation = to_datetime(os.path.getctime(index))     <<<< 
                    for result in  self._search_in_documentation(doc, keywords):
                        result['url'] =  req.href.doxygen(doc) + '/' \
                          
...
 if os.path.exists(index):
>>>>                creation = to_datetime(os.path.getctime(index))  <<<< 
                for result in self._search_in_documentation('', keywords):
             

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by Blackhex

  • Owner changed from Blackhex to cboos

Yes, it's relict form 0.10 branch since none is really maintaining this plugin.

comment:2 Changed 6 years ago by giel

This fix doesn't work for me. doxygentrac-typeerror-comparison-datetime-float-fix.2.patch from #3079 works however (is a combination of my own first attempt at fixing and this one).

comment:3 Changed 2 years ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

This was fixed in [5596].

Add Comment

Modify Ticket

Action
as closed The owner will remain cboos.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.