Forums / Setup & design / [solved] Unknown error message on search pages

[solved] Unknown error message on search pages

Author Message

Nathan Kelly

Tuesday 15 November 2005 6:02:35 pm

Hi all, another error has popped up but I (as usual) have no idea why.

By the way when I say "has just popped up" I mean it has been there since install but I have only now started working on the search pages so I'm only now wondering why its there.

Does anyone know why I get the following error on my search pages?

Error: eZMySQLDB  	Nov 16 2005 12:47:43

Query error: Unknown column 'Array' in 'where clause'. Query: SELECT ezcontentobject.*,
                       ezcontentobject_tree.*,
                       ezcontentclass.name as class_name,
                       ezcontentclass.identifier as class_identifier
                       , ezcontentobject_name.name as name,  ezcontentobject_name.real_translation 
                FROM ezcontentobject_tree,
                     ezcontentobject,
                     ezcontentclass
                     , ezcontentobject_name 
                WHERE ezcontentobject_tree.path_identification_string=Array AND 
                      ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
                      ezcontentclass.version=0  AND
                      ezcontentclass.id = ezcontentobject.contentclass_id
                       and  ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
                                  ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
                                  ezcontentobject_name.content_translation = 'eng-AU'

Notice: eZMySQLDB::query(0.000 ms) query number per page:1 	Nov 16 2005 12:47:43

SELECT ezcontentobject.*,
                       ezcontentobject_tree.*,
                       ezcontentclass.name as class_name,
                       ezcontentclass.identifier as class_identifier
                       , ezcontentobject_name.name as name,  ezcontentobject_name.real_translation 
                FROM ezcontentobject_tree,
                     ezcontentobject,
                     ezcontentclass
                     , ezcontentobject_name 
                WHERE ezcontentobject_tree.path_identification_string=Array AND 
                      ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
                      ezcontentclass.version=0  AND
                      ezcontentclass.id = ezcontentobject.contentclass_id
                       and  ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
                                  ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
                                  ezcontentobject_name.content_translation = 'eng-AU' 

I'm using the standard search templates and have made no changes so I'm unsure why I would be getting this error unless my database is messed up?

The error message is not very clear to me, I know it refers to a MYSQL query but I have no idea what an <i>unknown column 'Array' in a 'where clause'</i> is.

Any help is very much appreciated.

Cheers!

Pardon me while I burst into flames...

Bruce Morrison

Tuesday 15 November 2005 8:55:52 pm

Hi Nathan

This error because the this line

ezcontentobject_tree.path_identification_string=Array'

The search was passed an array variable where it is expecting a string.

Can you post the HTML of the search form?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Nathan Kelly

Tuesday 15 November 2005 9:29:29 pm

I figured it was something like that, the search form I am currently using (still in the making) is as follows:

{let search=false()}
{section show=$use_template_search}
{set search=fetch('content', 'search', hash('text', $search_text,
                           'section_id', $search_section_id,
                           'subtree_array', $search_sub_tree,
                           'class_id', $search_contentclass_id,
                           'class_attribute_id', $search_contentclass_attribute_id,
                           'offset', $view_parameters.offset,
                           'publish_date', $search_date,
                           'limit', $page_limit) ) }
			   
{set search_result=$search['SearchResult']}
{set search_count=$search['SearchCount']}
{set stop_word_array=$search['StopWordArray']}
{set search_data=$search}
{/section}

					<h3>{'Search CCTS'|i18n("design/ccts")}</h3>

					<form action={"/content/advancedsearch/"|ezurl} method="get">
						
						<fieldset>
							
							<h3>{'Search the CCTS website'|i18n("design/ccts")}</h3>
							<label class="alt-light">{'Search for selected words'|i18n("design/ccts")} <input type="text" size="45" name="SearchText" value="{$full_search_text|wash}" /></label>
							<p>-{'or'|i18n("design/ccts")}-</p>
							<label class="alt-dark">{'Search for the exact phrase'|i18n("design/ccts")} <input type="text" size="45" name="PhraseSearchText" value="{$phrase_search_text|wash}" /></label>

							<div class="buttons">
								<input class="button" type="submit" name="SearchButton" value="{'Search'|i18n('design/standard/content/search')}" />
							</div>
								
						</fieldset>
							
					</form>

{section show=or($search_text,eq(ezini('SearchSettings','AllowEmptySearch','site.ini'),'enabled') )}

{switch name=Sw match=$search_count}
{case match=0}
  
  					<div class="warning">
						
						<h4>{'No results were found when searching for "%1"'|i18n("design/standard/content/search",,array($search_text|wash))}</h4>
						
					</div>
{/case}
{case}

					<div class="feedback">

						<h4>{'Search for "%1" returned %2 matches'|i18n("design/standard/content/search",,array($search_text|wash,$search_count))}</h4>

					</div>
{/case}
{/switch}

{include name=Result uri='design:content/searchresult.tpl' search_result=$search_result}
{/section}

{include name=navigator
         uri='design:navigator/google.tpl'
         page_uri='/content/advancedsearch'
         page_uri_suffix=concat('?SearchText=',$search_text|urlencode,'&PhraseSearchText=',$phrase_search_text|urlencode,'&SearchContentClassID=',$search_contentclass_id,'&SearchContentClassAttributeID=',$search_contentclass_attribute_id,'&SearchSectionID=',$search_section_id,$search_timestamp|gt(0)|choose('',concat('&SearchTimestamp=',$search_timestamp)),$search_sub_tree|gt(0)|choose( '', concat( '&', 'SubTreeArray[]'|urlencode, '=', $search_sub_tree|implode( concat( '&', 'SubTreeArray[]'|urlencode, '=' ) ) ) ),'&SearchDate=',$search_date,'&SearchPageLimit=',$search_page_limit)
         item_count=$search_count
         view_parameters=$view_parameters
         item_limit=$page_limit}

	 					
{/let}

I know there may be a problem with my code and I accept that, the thing is this error has been showing up since the day I installed eZpublish, so I figure it might be something to do with my server set up maybe?

Also I have run into another small problem (probably my fault this one, and may be related), when searching for a single word the results show up in the expected fashion, however if I search for two words or more, for example, "content management system" or for a phrase, the title shows that 4 (for example) matches have been found but the matches are not displayed?

As I said this may be my fault as I have hacked a rather large chunk of code out of the search template, things like search by date published etc.

I'll try a complete fallback to the original templates and see what happens.

Cheers!

Pardon me while I burst into flames...

Nathan Kelly

Tuesday 15 November 2005 9:37:57 pm

Ooh, ok tried the fall back, cleared cache, same results - with the exception of a new (additional) error.

Error: eZMySQLDB  	Nov 16 2005 16:32:33

Query error: Unknown column 'ezsearch_tmp_1.frequency' in 'field list'. Query: SELECT DISTINCT ezcontentobject.*, ezcontentclass.name as class_name, ezcontentobject_tree.*
                            , ezcontentobject_name.name as name,  ezcontentobject_name.real_translation 
                            , ezsearch_tmp_0.frequency  + ezsearch_tmp_1.frequency  AS frequency
                    FROM
                       ezsearch_tmp_0 , ezsearch_tmp_1  ,
                       ezcontentobject,
                       ezcontentclass,
                       ezcontentobject_tree
                       , ezcontentobject_name 
                       
                    WHERE
                     ezsearch_tmp_0.contentobject_id=ezsearch_tmp_1.contentobject_id    AND 
                    ezcontentobject.id=ezsearch_tmp_0.contentobject_id AND
                    ezcontentobject.contentclass_id = ezcontentclass.id and
                    ezcontentclass.version = '0' and
                    ezcontentobject.id = ezcontentobject_tree.contentobject_id and
                    ezcontentobject_tree.node_id = ezcontentobject_tree.main_node_id
                     and  ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
                                  ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
                                  ezcontentobject_name.content_translation = 'eng-AU' 
                    AND ezcontentobject_tree.is_invisible = 0
                    
                    ORDER BY  frequency DESC
LIMIT 0, 10

Notice: eZMySQLDB::query(0.000 ms) query number per page:1 	Nov 16 2005 16:32:33

SELECT DISTINCT ezcontentobject.*, ezcontentclass.name as class_name, ezcontentobject_tree.*
                            , ezcontentobject_name.name as name,  ezcontentobject_name.real_translation 
                            , ezsearch_tmp_0.frequency  + ezsearch_tmp_1.frequency  AS frequency
                    FROM
                       ezsearch_tmp_0 , ezsearch_tmp_1  ,
                       ezcontentobject,
                       ezcontentclass,
                       ezcontentobject_tree
                       , ezcontentobject_name 
                       
                    WHERE
                     ezsearch_tmp_0.contentobject_id=ezsearch_tmp_1.contentobject_id    AND 
                    ezcontentobject.id=ezsearch_tmp_0.contentobject_id AND
                    ezcontentobject.contentclass_id = ezcontentclass.id and
                    ezcontentclass.version = '0' and
                    ezcontentobject.id = ezcontentobject_tree.contentobject_id and
                    ezcontentobject_tree.node_id = ezcontentobject_tree.main_node_id
                     and  ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
                                  ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
                                  ezcontentobject_name.content_translation = 'eng-AU' 
                    AND ezcontentobject_tree.is_invisible = 0
                    
                    ORDER BY  frequency DESC
LIMIT 0, 10 

Used templates:

design/standard/templates/content/advancedsearch.tpl

design/standard/templates/content/searchresult.tpl

I have made no changes to these files, they are the templates that come with the ez distribution, however the results are the same, I still get the errors and I still get no output with multiple word searching and phrase searching.

I don't know enough about ez to know if this is an .ini problem or server config problem?

Cheers!

Pardon me while I burst into flames...

Bruce Morrison

Tuesday 15 November 2005 10:53:47 pm

Hi Nathan

Are you using a plain ez install with no additions? What version or eZ ?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Nathan Kelly

Wednesday 16 November 2005 3:36:11 pm

Bruce, I'm using Ez v3.6.0 I installed it with the minimum, plain install.

As far as addons, there are no forums, shop, blogs etc. but if you mean extensions I have enhancedselection installed, thats it.

When I installed I had the following folders in the design directory:
* admin
* base
* plain
* standard
* mysite

I added my own empty folder (mysite) and I have slowly built it up with custom templates to the point where I am overriding all of the required templates, I have kept the directory structure the same as the plain folder.

In my settings/siteaccess directory I have the following:
* admin
* mysite
* mysite_admin
* setup

I'm not using the plain design so it is not included in my design settings settings/siteaccess/mysite/site.ini.append.php

[DesignSettings]
SiteDesign=ccts
AdditionalSiteDesignList[]=base

The install was smooth no problems at all.

Additionally I posted somewhere on these forums a couple of weeks ago a concern I had when checking my database tables via phpmyadmin, I get this message at the end of the check

Problems with indexes of table `ezcontentobject_attribute`
Warning More than one INDEX key was created for column `contentobject_id`
Problems with indexes of table `ezenumobjectvalue`
Warning PRIMARY and INDEX keys should not both be set for column `contentobject_attribute_id`

But knowing little to nothing about SQL I don't know how to fix it, I have wondered if this may be causing problems. You may have some idea?

If you need any more info let me know, I really would like to sort these last few issues out, I've come so far with the site and I'm happy with eZ but these little problems are really holding things up!

Cheers!

Pardon me while I burst into flames...

Nathan Kelly

Wednesday 16 November 2005 3:40:54 pm

Oh one other thing I should mention I'm using your http://ez.no/community/contribs/hacks/title_weighed_word_frequency_search_plugin

but the problems were in place before I installed this so its my opinion that it has not affected anything.

Cheers!

Pardon me while I burst into flames...

Bruce Morrison

Wednesday 16 November 2005 8:38:30 pm

Hi Nathan

Are you in Australia? Is the site you are working on availiable via the public internet?

Drop me an email at bruce@designit.com.au to see if we can sort out a better way of working through these issues.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Nathan Kelly

Thursday 17 November 2005 2:48:12 pm

Hi Bruce, will do, the site is accessible via IP and yes I'm in Australia.

Cheers!

Pardon me while I burst into flames...

Nathan Kelly

Sunday 20 November 2005 2:34:43 pm

Cheers Bruce, I installed the new patch:
http://ez.no/community/contribs/hacks/title_weighed_word_frequency_search_plugin
the search is working perfectly now.

Pardon me while I burst into flames...