I've applied several of the patches which removed the various errors I was getting when trying to search. However, my search still returns no results for strings which ought to give results.

Comments

mdallmeyer’s picture

Bump. Is this module still being maintained? No updates for Drupal 6 since 2011...

tekante’s picture

What do you get when you try to access the following path on your site /imce_search_callback? You should see a JSON response with a message embedded similar to "Invalid search criteria, please specify a search". You can try the searching directly using a path of the form /imce_search_callback/1/TEST (replacing test with a search string). This will perform a case insensitive search.

Also, note that this searches your files table so if you have files on the filesystem uploaded in a manner that does not result in an entry in the files table those files will not appear in search results.

inversed’s picture

Issue summary: View changes

I was having a similar problem on version 7.x-1.2 which may have been related to the original poster's issue. The end result was that the loader icon for the search kept spinning and no results or errors were being shown ()other than a JS error in the console).

For me, the problem was that the Devel module's footer was being injected into the JSON output of the callback function. According to the the devel.module's devel_shutdown_real() function, it is supposed to suppress this if the header content type is JSON (among other things).

I put a fix in place to manually disable the footer on the callback page but I think the right solution would be to correctly set the header in the IMCE search callback results.

Edit: Looks like changing "drupal_json_encode" to "drupal_json_output" solves the problem in the right way. I'll try to post a patch when I get a chance.

ladybug_3777’s picture

I think this is the same error I'm seeing! The javascript error being spit out is

"class is a reserved identifier"

And it appears to be pointing to the response HTML of

<div class="dev-query"> Page execution time was 269.19 ms.</div>

I'm going to try your solution inversed

ladybug_3777’s picture

Bummer, changing it to...

 echo drupal_json_output($suggestions);

...did not work. Instead it gave a new error.

SyntaxError: missing ] after element list
([object Object])

However, going into Devel's config and turning off the option for "Display page timer
Display page execution time in the query log box." does make the error go away.

Not ideal, but will work in a pinch for me right now.

gold’s picture

Version: 6.x-1.1 » 7.x-1.2

Hmm... I'm having a similar issue to the OP but in my case the issue appears to be that the search isn't firing. I'm on 1.2 and the "search" button is an HTML Button. The JS that processes the click is fired from the form submit.

I get the JS running in 2 different scenarios;

  • if I change the form element from button to submit
  • if I change the JS to fire when the button is clicked

Either of these should work. I am however getting a JS error on these though.

I'm going to switch to the dev branch and start fixing this. I should have a patch soon.

gold’s picture

Findings;

The 7.x-dev branch appears to be working with jQuery Update and the devel "Display X" options disabled. This is what I've found;

  1. jQuery 1.4 (Drupal core)
  2. jQuery 1.5
  3. jQuery 1.7
  4. jQuery 1.8
  5. jQuery 1.9
  6. jQuery 1.10
  7. jQuery 1.11
  8. jQuery 2.1

With this in mind, is this still an issue?