Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The menu item "admin/reports/search" as provided by search.module should be provided by the dblog module. Visiting this page when dblog is not installed results in an error.
Comment | File | Size | Author |
---|---|---|---|
#27 | 421838.drupal.search-report.d6.patch | 1.41 KB | joachim |
#22 | search-report.patch | 1.75 KB | jbrown |
#16 | 421838-fixtabs.patch | 1.37 KB | jhodgdon |
#13 | 421838-2.patch | 1.39 KB | mradcliffe |
#7 | 421838.patch | 1.38 KB | jhodgdon |
Comments
Comment #1
ff1 CreditAttribution: ff1 commentedI just tried this and the 'Top search phrases' page works both with and without the dblog module.
If this is still a problem for you, please provide more details of the error message.
Ian
Comment #3
sdrycroft CreditAttribution: sdrycroft commentedSorry Ian, RTFC...
Comment #4
jhodgdonAgreed, this looks like a real bug.
Comment #5
jhodgdonThis menu item should really only exist if *both* the search module and the dblog module are turned on, by the way.
Comment #6
jhodgdonThis is the same in Drupal 7 and should likely be fixed there first, then backported to D6.
Comment #7
jhodgdonOK, here's a simple patch, which works fine. When running search_menu(), it only adds the Top Search Phrases report to the menu item list if dblog.module is enabled.
The other way to do this would be to put the menu item into dblog_menu() and change it to module_exists('search'). Which will have exactly the same effect, so I don't have strong feelings one way or another.
Comment #8
jhodgdonI also confirmed that without this patch, if dblog.module has been uninstalled (not just disabled), if you go to admin/reports/search you get a big orange error box saying:
So I think the patch is needed for Drupal 7.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch works for me, when dblog is disabled or uninstalled.
Comment #10
jhodgdon#7: 421838.patch queued for re-testing.
Comment #12
jhodgdonLooks like this patch needs rerolling
Comment #13
mradcliffere-rolled. there was just a 2 line offset. I'm not sure why it failed to patch that?
Comment #14
jhodgdonAnyone want to review this? I wrote the patch, so I can't. chrisdolby in #9 confirmed that it works, but the patch still needs a review. :)
Comment #15
mradcliffeI did test it visually myself, and it works.
I only remember doing these hook_menu conditionals in Drupal 5 or 6 in contrib. I thought maybe menu_enable was the only thing to call menu_rebuild on module_enable, but it looks like it's happening anyway.
Comment #16
jhodgdonThe patch in #13 has a tab/space indentation issue that was not in the original patch.
Here's another reroll.
Comment #17
jhodgdon#16: 421838-fixtabs.patch queued for re-testing.
Comment #18
quex CreditAttribution: quex commented#13: 421838-2.patch queued for re-testing.
Comment #19
jbrown CreditAttribution: jbrown commentedComment #20
Dries CreditAttribution: Dries commentedMaybe we should move the menu handler to the dblog module instead of adding a module_exists()? Not 100% sure why we have it in search.module.
Comment #21
jhodgdonIt's a report of the most recent (or is it popular?) search terms. It doesn't work correctly unless both the search and dblog are turned on.
I think it makes most sense to leave it in search.module, but only turn it on if dblog is turned on.
Comment #22
jbrown CreditAttribution: jbrown commenteddblog_top('search') lists the watchdog entries that are of type 'search'.
Technically, you could uninstall the search module and this would still list the search entries that occurred when the search module was active. But this would be confusing I think.
This menu item shouldn't appear unless both search and dblog are enabled.
It makes sense for it to be in dblog as that module has the function to be called and we can leave off the 'file path' setting.
Comment #23
jhodgdonPatch works, approach is fine with me.
Comment #24
colanSubscribing.
Comment #25
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #26
jhodgdonMaybe we should port this to Drupal 6?
Comment #27
joachim CreditAttribution: joachim commentedHere's a patch on D6.
Comment #28
jhodgdonWhen you upload patches, please read the info about extensions on the Attachments field (don't put d6 in the extension).
This patch looks right but someone should test it in D6 and make sure:
- the problem exists without the patch (see #8)
- the problem is fixed with the patch
- the report still works if both search and dblog are enabled
Comment #29
TravisCarden CreditAttribution: TravisCarden commented