Download & Extend

remove admin/content/search - it's broken

Project:Drupal core
Version:6.x-dev
Component:node.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

on the admin/node/search we have an advaced seearch option, yet taht does not work.

I vote for completely removing that page. I see no benefit in a special search page inside admin, esp. since it hardly differs from the side-wide search.

Comments

#1

Version:4.7.0-beta1» 4.7.0-beta2

This bug is still present in beta2. I think Ber is right, this page is redundant unless the advanced search is only available to admins.

#2

That page also has some help strings which talk about wildcards. According to http://drupal.org/node/41510 they're no longer supported, so that needs to be fixed, too.

#3

Title:admin/node/search advanced does not work» remove search at admin/node/search (admin/node/search advanced does not work)

But there is no setting and no permission to allow only admins to search. Hence this page is completely redundant. If you only want yourself to search nodes, you must use the default search permission anyway.
Also, thios page used to return also 'disabled' nodes. Which no longer is the case.

#4

Version:4.7.0-beta2» x.y.z

moving to cvs.

#5

Assigned to:Anonymous» mbchandar

hi,

here is the patch for search.module

*** modules/search.module 2006-05-10 13:51:44.000000000 +0530
--- modules/search.module1 2006-05-10 12:54:45.000000000 +0530
***************
*** 360,364 ****
// With the exception of the rules above, we consider all punctuation,
// marks, spacers, etc, to be a word boundary.
! //$text = preg_replace('/['. PREG_CLASS_SEARCH_EXCLUDE . ']+/u', ' ', $text);

return $text;
--- 360,364 ----
// With the exception of the rules above, we consider all punctuation,
// marks, spacers, etc, to be a word boundary.
! $text = preg_replace('/['. PREG_CLASS_SEARCH_EXCLUDE . ']+/u', ' ', $text);

return $text;
***************
*** 737,741 ****

// Build word-index conditions for the first pass
! $query2 = substr(str_repeat("i.word like '%s' OR ", count($arguments2)), 0, -4);

return array($query, $arguments, $query2, $arguments2, $matches);
--- 737,741 ----

// Build word-index conditions for the first pass
! $query2 = substr(str_repeat("i.word = '%s' OR ", count($arguments2)), 0, -4);

return array($query, $arguments, $query2, $arguments2, $matches);

here is the patch for node.module

*** modules/node.module 2006-05-10 12:55:24.000000000 +0530
--- modules/node.module1 2006-05-10 12:53:44.000000000 +0530
***************
*** 698,702 ****

// Do search
- $keys=str_replace("*","%",$keys);
$find = do_search($keys, 'node', 'INNER JOIN {node} n ON n.nid = i.sid '. $join1 .' INNER JOIN {users} u ON n.uid = u.uid', $conditions1 . (empty($where1) ? '' : ' AND '. $where1), $arguments1, $select2, $join2, $arguments2);

--- 698,701 ----

save this patch and patch the node.module and search.module file.

it will work

#6

Status:active» needs work

Please attach as real patch. Thanks for the work though.

More info on http://drupal.org/diffandpatch

#7

Version:x.y.z» 6.x-dev
Status:needs work» active

Please attach a patch. It's difficult to test patches that aren't attached.

#8

Title:remove search at admin/node/search (admin/node/search advanced does not work)» remove admin/content/search - it's broken
Component:search.module» node.module
Priority:normal» critical
Assigned to:mbchandar» catch
Status:active» needs review

OK the search page at admin/content/search does absolutely nothing now - both normal and advanced search. Page refreshes, no search is run.

This patch just removes the menu item and associated function completely from node module.

AttachmentSizeStatusTest resultOperations
40934.patch2.17 KBIgnored: Check issue status.NoneNone

#9

Two arguments for removing rather than trying to correct it:

1. http://drupal.org/node/146466 needs to go in (and I double checked that it has no effect on this being broken or not).

2. This is a two year old issue, with a handful of posts on it. I was unable to find any duplicate issues or forum topics with a cursory search, so from that I think we can assume that almost no-one actually uses admin/content/search.

3. If search is enabled, there's usually a search box/link somewhere on every page anyway.

#10

Status:needs review» needs work

Patch doesn't apply for me.

I agree that the right option is to remove this menu item. The righ way to implement content search is to remake the filter functionality on /admin/content/node to a filter/search functionality.

#11

Status:needs work» needs review

hmm re-roll.

AttachmentSizeStatusTest resultOperations
content_search_remove.patch2.17 KBIgnored: Check issue status.NoneNone

#12

Assigned to:catch» Anonymous
Status:needs review» needs work

patch applies for me on debian but it says "stripping trailing CRs". I'm patching on windows with notepad++ and tortoise so probably due to that. I don't have cvs set up on my vps, so probably not able to re-roll cleanly. Back to needs work and hopefully someone can take this up.

#13

I see. Changed the line endings to UNIX and patch applies.

(catch: There is a handbook page dedicated to creating patches on Windows, or you can contact me offlist and I give you my killer Windows patch setup)

AttachmentSizeStatusTest resultOperations
content_search_remove_0.patch2.12 KBIgnored: Check issue status.NoneNone

#14

Status:needs work» needs review

changing status. fajerstarter I'll check the handbook page again, otherwise I might take you up on that.

#15

I should mention that I did test the patch and it works a expected (as always, enable/disable a module to re-build the menu). Don't know the the code enough to say if all trails of this functionality is removed.

#16

I did a search of the whole drupal directory for as many references as I could find, but yeah it could do with someone who has more familiarity to see if there's anything left.

#17

Status:needs review» fixed

Indeed, I checked the search functionality and it does not seem like doing anything well. It is also the same interface as the usual search page. I also grepped the Drupal source for some more locations this is used or referenced, but found nothing:

gabor$ grep -R node_admin_search *
modules/node/node.admin.inc:function node_admin_search() {
modules/node/node.module:      'page callback' => 'node_admin_search',
gabor$ grep -R "admin/content/search" *
modules/node/node.admin.inc:  return drupal_get_form('search_form', url('admin/content/search'), $keys, 'node') . search_data($keys, 'node');
modules/node/node.module:    case 'admin/content/search':
modules/node/node.module:    $items['admin/content/search'] = array(

Thanks, committed.

#18

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

nobody click here