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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grohk’s picture

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.

Uwe Hermann’s picture

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.

Bèr Kessels’s picture

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.

killes@www.drop.org’s picture

Version: 4.7.0-beta2 » x.y.z

moving to cvs.

mbchandar’s picture

Assigned: Unassigned » 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

Bèr Kessels’s picture

Status: Active » Needs work

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

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

bdragon’s picture

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.

catch’s picture

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
Assigned: mbchandar » catch
Priority: Normal » Critical
Status: Active » Needs review
FileSize
2.17 KB

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.

catch’s picture

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.

anders.fajerson’s picture

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.

catch’s picture

Status: Needs work » Needs review
FileSize
2.17 KB

hmm re-roll.

catch’s picture

Assigned: catch » Unassigned
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.

anders.fajerson’s picture

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)

catch’s picture

Status: Needs work » Needs review

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

anders.fajerson’s picture

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.

catch’s picture

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.

Gábor Hojtsy’s picture

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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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