Search not working 3.9

Author Message

Seth Shoultes

Friday 23 February 2007 11:39:51 pm

I get a module not found in ezPublish 3.9. When trying to do a search.

Module not found
The requested module SearchText=lorem could not be found.
Possible reasons for this are:
The module name was misspelled, try changing the URL.
The module does not exist on this site.
This site uses siteaccess matching in the URL and you didn't supply one, try inserting a siteaccess name before the module in the URL .

Why is this not working??

Claudia Kosny

Saturday 24 February 2007 1:34:36 am

Hi Seth

Hmm, this looks like the action attribute of your search form is not correct. Have a look at the template code that produces the search form. Make sure it says something like <form action={"/content/search"|ezurl}>.
If that is not the problem please post the template code of the search form and the url that appears in the address bar of your browser when you get the error message.

Claudia

Seth Shoultes

Saturday 24 February 2007 9:18:15 pm

Here is the entire code for the search template:

{let search=false()}
{section show=$use_template_search}
{set page_limit=10}
{set search=fetch(content,search,
hash(text,$search_text,
section_id,$search_section_id,
subtree_array,$search_subtree_array,
sort_by,array('modified',false()),
offset,$view_parameters.offset,
limit,$page_limit))}
{set search_result=$search['SearchResult']}
{set search_count=$search['SearchCount']}
{set stop_word_array=$search['StopWordArray']}
{set search_data=$search}
{/section}

<div class="box">
<div class="tl"><div class="tr"><div class="br"><div class="bl"><div class="box-content float-break">

<div class="content-search">

<form action={"/content/search/"|ezurl} method="post">

<div class="attribute-header">
<h1 class="long">{"Search"|i18n("design/ezwebin/content/search")}</h1>
</div>

<p>
<input class="halfbox" type="text" size="20" name="SearchText" id="Search" value="{$search_text|wash}" />
<input class="button" name="SearchButton" type="submit" value="{'Search'|i18n('design/ezwebin/content/search')}" />
</p>

{let adv_url=concat('/content/advancedsearch/',$search_text|count_chars()|gt(0)|choose('',concat('?SearchText=',$search_text|urlencode)))|ezurl}
<label>{"For more options try the %1Advanced search%2"|i18n("design/ezwebin/content/search","The parameters are link start and end tags.",array(concat("<a href=",$adv_url,">"),"</a>"))}</label>
{/let}

{section show=$stop_word_array}
<p>
{"The following words were excluded from the search"|i18n("design/ezwebin/content/search")}:
{section name=StopWord loop=$stop_word_array}
{$StopWord:item.word|wash}
{delimiter}, {/delimiter}
{/section}
</p>
{/section}

{switch name=Sw match=$search_count}
{case match=0}
<div class="warning">
<h2>{'No results were found when searching for "%1"'|i18n("design/ezwebin/content/search",,array($search_text|wash))}</h2>
</div>
<p>{'Search tips'|i18n('design/ezwebin/content/search')}</p>
<ul>
<li>{'Check spelling of keywords.'|i18n('design/ezwebin/content/search')}</li>
<li>{'Try changing some keywords eg. car instead of cars.'|i18n('design/ezwebin/content/search')}</li>
<li>{'Try more general keywords.'|i18n('design/ezwebin/content/search')}</li>
<li>{'Fewer keywords gives more results, try reducing keywords until you get a result.'|i18n('design/ezwebin/content/search')}</li>
</ul>
{/case}
{case}
<div class="feedback">
<h2>{'Search for "%1" returned %2 matches'|i18n("design/ezwebin/content/search",,array($search_text|wash,$search_count))}</h2>
</div>
{/case}
{/switch}

{section name=SearchResult loop=$search_result show=$search_result sequence=array(bglight,bgdark)}
{node_view_gui view=line sequence=$:sequence use_url_translation=$use_url_translation content_node=$:item}
{/section}

{include name=Navigator
uri='design:navigator/google.tpl'
page_uri='/content/search'
page_uri_suffix=concat('?SearchText=',$search_text|urlencode,$search_timestamp|gt(0)|choose('',concat('&SearchTimestamp=',$search_timestamp)))
item_count=$search_count
view_parameters=$view_parameters
item_limit=$page_limit}

</form>

</div>

</div></div></div></div></div>
</div>

{/let}

Claudia Kosny

Sunday 25 February 2007 8:43:48 am

Hi Seth

Try to access the search form directly. To do this just add content/search after the siteaccess, like this: .../index.php/ezwebin_site/content/search (assuming you use url matching)
Can you see the page? If yes, try to search from here - does that work?

And please post the url the caused the error in your first post.
Is this a fresh installation of eZ 3.9.0 or did you make some changes to the templates?

BTW: It is very unlikely that this is the template code that produces the search form which you used for searching as the form method here is post and your first posting clearly indicates that the form method was get.

Claudia

Seth Shoultes

Sunday 25 February 2007 3:17:34 pm

This is a fresh install of ezPublish. I have changed the search templates, that I could find, to use POST. The GET method returns errors as well.

Here is the URL that comes up in the address bar, when I try to do a search from the home page while POST is set:
http://www.swsutah.com/ezpublish/index.php?SearchText=lorem

Here is the URL that comes up using the GET method:
http://www.swsutah.com/ezpublish/index.php?SearchText=lorem&SearchButton=Search

Your suggestion works I can bring up the search form and it works using the POST method:
http://www.swsutah.com/ezpublish/index.php?/eng/content/search

When I press the 'Next' link to see more results, using the POST method, I get an error. Here is the URL:
http://www.swsutah.com/ezpublish/index.php?/eng/content/search/(offset)/10?SearchText=lorem

Hope this information helps. You can also test it out using the above URL's. The search is currently set to use the POST method.

Claudia Kosny

Monday 26 February 2007 1:14:26 pm

Hi Seth

Unfortunately this is quite a problem. The PHP on your sever seems to run in CGI mode which is the reason for the first question mark in your urls. And when there is a second question mark - which happens every time you use a get parameter - eZ has problems determining the module. I read somewhere that setting 'forcevirtualhost' to true in the site.ini might help with this problem, but I could not find any confirmation.
If you search for 'php cgi search' on the ez.no website you can find a few forum entries. I have looked at only a couple, so I don't know whether there is a solution somewhere.

A possible, if cumbersome solution might be to leave the forms with method post. To enable browsing through several pages of a search result you need to change the links so that the search text is a view parameter as this works without question marks. Then change the file kernel/content/search such that if there is no searchText variable in ezHttp, the viewparameters are tried as well. I am not 100% sure that this will work, but is not very hard to do.

If you find a better solution please post it here - there are certainly others with the same problem...

Claudia

Seth Shoultes

Tuesday 27 February 2007 6:49:03 pm

I cant seem to find 'forcevirtualhost' in the site.ini or site.in.append.php files.

Seth Shoultes

Tuesday 27 February 2007 7:00:44 pm

Ok I added 'ForceVirtualHost=true' to the file site.ini.append.php

This is the error I got from doing that:

Module not found
The requested module index.php could not be found.
Possible reasons for this are:
The module name was misspelled, try changing the URL.
The module does not exist on this site.
This site uses siteaccess matching in the URL and you didn't supply one, try inserting a siteaccess name before the module in the URL .

Claudia Kosny

Wednesday 28 February 2007 2:00:31 pm

Hi Seth

Sorry but I can't help you there. I have not used this forcevirtualhost setting and don't know what exactly this is doing. I thought that it removes the index.php part of the urls but this does not seem to be the case. Or maybe you just need to clear the cache?

Good luck

Claudia

Jianjun Hu

Monday 25 June 2007 10:03:02 pm

I've found the following <b>*search.tpl</b> files:

./design/admin/templates/content/advancedsearch.tpl
./design/admin/templates/content/search.tpl
./design/admin/templates/node/view/search.tpl
./design/base/templates/content/search.tpl
./design/standard/templates/content/advancedsearch.tpl
./design/standard/templates/content/search.tpl
./design/standard/templates/node/view/search.tpl
./var/storage/packages/ez_systems/ezwebin_extension/ezextension/ezwebin/design/ezwebin/templates/content/advancedsearch.tpl
./var/storage/packages/ez_systems/ezwebin_extension/ezextension/ezwebin/design/ezwebin/templates/content/search.tpl
./extension/ezwebin/design/ezwebin/templates/content/advancedsearch.tpl
./extension/ezwebin/design/ezwebin/templates/content/search.tpl

I meet the same problem.
I will read these posts later and midify my post.
Thanks!

OnlyBlue

☆..·°∴°.☆°°.☆°.
°∴ °☆ .·enjoy star° .·★°∴°
∴°.°★ .·°
  ミ☆°∴°.★☆° ∴·°
°.☆° .·∴° 

Is it a pleasure after all to practice in due time what one has learnt?

Pascal Specht

Tuesday 26 June 2007 12:35:07 am

Hi!

< Ok I added 'ForceVirtualHost=true' to the file site.ini.append.php
< This is the error I got from doing that:
< <b>Module not found</b>
< <b>The requested module index.php could not be found.</b>

If you used the ezwebin admin interface to change the ForcVirtualHost=true, this is normal. Just after you changed the value, the page needs to be refreshed, but the URL you still have in the adress bar is pointing to the OLD adressing scheme, including the now useless index?

So typically, what I did to change to ForceVirtualHost is :

log into the interface through http://www.store.com/<b>index.php?/</b>ezwebin_site_admin
Edit the setting and set ForceVirtualHost to TRUE for the siteAccess ezwebin_site (global override)
After this change, the module will show your error page !
Remove index.php?/ from the URL in the adress bar and refresh your page:
http://www.store.com/ezwebin_site_admin
Then go to the desing settings for the ezwebin_design site access and remove /index.php? as well from the different site access URLs there.

My httpd conf also shows the following: (apache2)

ServerName store.customer.com
DocumentRoot /home/customer/www/

<Directory "/home/customer/www">
      allow from all
      Options -Indexes
      Options FollowSymLinks
      AllowOverride None
</Directory>


RewriteEngine On

<IfModule mod_rewrite.c>
        RewriteEngine On
        
        RewriteRule ^/some_of_my_pages.php$ /some_of_my_pages.php [L]

        Rewriterule ^/var/storage/.* - [L]
        Rewriterule ^/var/[^/]+/storage/.* - [L]
        RewriteRule ^/var/cache/texttoimage/.* - [L]
        RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
        Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
        Rewriterule ^/share/icons/.* - [L]
        Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
        Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
        RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
        RewriteRule ^/favicon\.ico - [L]
        RewriteRule ^/robots\.txt - [L]
        RewriteRule .* /index.php
</IfModule>

   AddHandler x-httpd-php4 .php

Hope this helps,

-Pascal

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.