Jump to content

'Please enter a search term in the search box (upper right corner)' when editing entries in admin


Tyssen
 Share

Recommended Posts

I've just tried editing some entries on a site I was working on last week with no problem, but today when I try to save my changes I get a white page with Please enter a search term in the search box (upper right corner).

Anyone ever had that happen before?

Link to comment
Share on other sites

The only place where I can find that text phrase is in our default site profile's, in the search.php template. What you've mentioned makes me think you are seeing this in the PW admin? It sounds to me like somehow your /site/templates/search.php file is getting included in whatever page you are viewing. The first thing I would check is the template (admin?) settings for page where you are seeing this message, on the "files" tab. This message occur if your /site/templates/search.php is set as an auto-prepend or auto-append file. You might also check your /site/config.php $config->prependTemplateFile and $config->appendTemplateFile. Lastly, look in your /site/templates/admin.php file to see if it contains what it should–perhaps someone overwrote it with the contents of search.php?

Link to comment
Share on other sites

All the fields under the files tab for the relevant template are blank. No $config values exist for prepend/appendTemplateFile and admin.php contains:

<?php 

/**
 * Admin template just loads the admin application controller, 
 * and admin is just an application built on top of ProcessWire. 
 *
 * This demonstrates how you can use ProcessWire as a front-end to another application. 
 *
 * Leave this file as-is, do not remove. 
 * 
 */

require($config->paths->adminTemplates . 'controller.php'); 

I've tried editing a couple of other pages that use different templates and they've saved OK, so it's only this one, which I added some new fields to last week, and which was fine when I made those updates, which is now throwing this error.

Link to comment
Share on other sites

You've definitely got something including that file somewhere, somehow. Otherwise you wouldn't see the text that it is outputting. Here's a shot in the dark, but do you have Adrian's 404 Search Results Generator module installed? That module loads your search template when a 404 occurs. If something on your admin page were generating a 404 (like a missing css file, image file, etc.) then it's feasible it might load that module, which would make it output the text you've described?

Link to comment
Share on other sites

I uninstalled the module and instead got taken to the site's 404 page. The entries I was trying to edit contained a link to a Google Map. With the link in place, I got the error, but if I removed https:// from the link, the entry saved OK.

Link to comment
Share on other sites

@Tyssen - sorry for the issues with my module - I have just pushed a new version to exclude PW admin pages - its hook on ProcessPageView::pageNotFound won't be added if not viewing a page on the front-end. This should be a nice improvement in general, but should also solve part of your issue. Please let me know how it goes.

Now onto the bigger issue of the google map link causing a 404 - can you please give us more details - what field type are you using for the url? Rather than removing the https:// entirely, what happens if you change it to http:// ?

Link to comment
Share on other sites

what field type are you using for the url? 

Text.

Rather than removing the https:// entirely, what happens if you change it to http:// ?

Same behaviour with both http and https but it saves OK if I prepend the link with //

Link to comment
Share on other sites

I am baffled why a text field containing http(s):// would throw a 404 error - maybe Ryan has some ideas.

What is the URL in the address bar that is throwing the 404 after saving the page?

It still might make more sense to use a URL field type for this purpose, assuming this field is always for URLs and is not more general purpose.

Link to comment
Share on other sites

What is the URL in the address bar that is throwing the 404 after saving the page?

Same URL as I'm already on.

It still might make more sense to use a URL field type for this purpose, assuming this field is always for URLs and is not more general purpose.

Same result except that with a URL field I can't remove the http/s so always get an error. At least as a text field I have the option of leaving it out and putting the protocol in the template.

Php Mod security installed?

Doesn't appear to be although there are several suhosin modules that are turned on.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...