Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 03:32:07 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149656 Posts in 21100 Topics by 7539 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Search page formatting problems  (Read 1645 times)
abidan

Offline Offline

Posts: 102


« on: April 15, 2009, 08:55:38 PM »

Hi

I have a problem with my search page. When i had this problem before it was to do with either permissions or missing files. Trouble is I dont know which files to look at to check for permsission of missing files. Allsearch files seem present and correct. If you look at this page http://www.buildmeafabwebsite.co.uk/search/index.php you can see that the page is not finishing with hte correct right nav and background as like http://www.buildmeafabwebsite.co.uk/ which renders correct.

Has anyone any ideas at all as i am stumped Sad

Thanks
Logged
abidan

Offline Offline

Posts: 102


« Reply #1 on: April 15, 2009, 09:05:54 PM »

I turned on error tracking and get this :
Fatal error: Call to a member function on a non-object in /home/sites/buildmeafabwebsite.co.uk/public_html/search/search.php on line 589
Logged
abidan

Offline Offline

Posts: 102


« Reply #2 on: April 16, 2009, 12:28:17 PM »

Can anyone help on this as i am really struggling to figure the problem Sad
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Online Online

Posts: 2094



WWW
« Reply #3 on: April 16, 2009, 12:59:18 PM »

It probably has something to do with a module that is installed and created a bad search entry or did not uninstall correctly.

Did you install or uninstall some modules recently?

Ruud
Logged

Professional WebsiteBaker Developer
abidan

Offline Offline

Posts: 102


« Reply #4 on: April 16, 2009, 02:44:27 PM »

Hmmmmmmmmm, cant remember. I have recently migrated my website to a new host and had similiar problems with other pages and yes i seem to rember it was module related. I wonder if i should remove all my mods and reinstall? What do you think? I have not installed one recently, but cnt be certain. Is there a mod that will show a list of installed mods and the dates they were installed Smiley

Thanks for help so far
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #5 on: April 16, 2009, 04:08:20 PM »

Hello,

there was two threads recently in the German sub forum about this issue.

In both cases this problem appears after cloning (page copy) a Forms-page (FormX may be affected, too).

thorn.
Logged

abidan

Offline Offline

Posts: 102


« Reply #6 on: April 16, 2009, 04:10:30 PM »

Oh interesting?

Is there any more information like links to the other threads.........if they are in German I unfortunately only speak English Sad so can someone translate how they fixed it??? or provide the link to the threads??

Thanks very much
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #7 on: April 16, 2009, 05:14:40 PM »

Is there any more information like links to the other threads........

No, there is no more information. They just told that
the problem was solved.


Would you be kind enough to help me to  locate the erroneous code?
Please insert into search/search.php around line 587 this code
Code:
if($module_name=='form') var_dump($sorted_modules, $prepared_query, $search_path_SQL);
EDIT: oh, you are using formx, right?. So add this instead:
Code:
if($module_name=='form') var_dump($sorted_modules, $prepared_query, $search_path_SQL);
if($module_name=='formx') var_dump($sorted_modules, $prepared_query, $search_path_SQL);


should be  (EDIT: fixed order of lines)
Code:
if($module_name=='form') var_dump($sorted_modules, $prepared_query, $search_path_SQL);
if($module_name=='formx') var_dump($sorted_modules, $prepared_query, $search_path_SQL);
// Execute query
$page_query = $database->query($prepared_query." ".$search_path_SQL);// Loop through queried items

Please post the result.

thorn.
« Last Edit: April 16, 2009, 05:35:50 PM by thorn » Logged

abidan

Offline Offline

Posts: 102


« Reply #8 on: April 16, 2009, 05:20:14 PM »

I inserted it and turned on the error stuff in back end:

Fatal error: Call to a member function on a non-object in /home/sites/buildmeafabwebsite.co.uk/public_html/search/search.php on line 590

thats all i get?Huh?

Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #9 on: April 16, 2009, 05:34:27 PM »

Argh, ok, my mistake.
The var_dump()-call has to be before the actual query...
Code:
if($module_name=='form') var_dump($sorted_modules, $prepared_query, $search_path_SQL);
if($module_name=='formx') var_dump($sorted_modules, $prepared_query, $search_path_SQL);
// Execute query
$page_query = $database->query($prepared_query." ".$search_path_SQL);
// Loop through queried items

thorn.
Logged

abidan

Offline Offline

Posts: 102


« Reply #10 on: April 16, 2009, 05:37:35 PM »

Ahhhhhaaaaa I get this:



Results For 'search': array(7) {
  • => array(4) {
  • => string(7) "wysiwyg" ["value"]=> string(7) "wysiwyg" [1]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" ["extra"]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" } [1]=> array(4) {
  • => string(4) "code" ["value"]=> string(4) "code" [1]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" ["extra"]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" } [2]=> array(4) {
  • => string(4) "news" ["value"]=> string(4) "news" [1]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" ["extra"]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" } [3]=> array(4) {
  • => string(9) "bookmarks" ["value"]=> string(9) "bookmarks" [1]=> string(86) "a:3:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";}" ["extra"]=> string(86) "a:3:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";}" } [4]=> array(4) {
  • => string(16) "download_gallery" ["value"]=> string(16) "download_gallery" [1]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" ["extra"]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" } [5]=> array(4) {
  • => string(Cool "faqmaker" ["value"]=> string(Cool "faqmaker" [1]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" ["extra"]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" } [6]=> array(4) {
  • => string(5) "formx" ["value"]=> string(5) "formx" [1]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" ["extra"]=> string(204) "a:6:{s:7:"page_id";s:7:"page_id";s:5:"title";s:10:"page_title";s:4:"link";s:4:"link";s:11:"description";s:11:"description";s:13:"modified_when";s:13:"modified_when";s:11:"modified_by";s:11:"modified_by";}" } } string(818) "SELECT wb_pages.page_id, wb_pages.page_title, wb_pages.link, wb_pages.descriptio n, wb_pages.modified_w hen, wb_pages.modified_b y FROM wb_mod_formx_fields, wb_mod_formx_settin gs, wb_pages WHERE ( ( ( wb_pages.page_id = wb_mod_formx_settin gs.page_id AND wb_mod_formx_settin gs.header LIKE '%search%' OR wb_pages.page_id = wb_mod_formx_settin gs.page_id AND wb_mod_formx_settin gs.footer LIKE '%search%' OR wb_pages.page_id = wb_mod_formx_fields .page_id AND wb_mod_formx_fields .title LIKE '%search%' ) ) OR ( ( wb_pages.page_id = wb_mod_formx_settin gs.page_id AND wb_mod_formx_settin gs.header LIKE '%search%' OR wb_pages.page_id = wb_mod_formx_settin gs.page_id AND wb_mod_formx_settin gs.footer LIKE '%search%' OR wb_pages.page_id = wb_mod_formx_fields .page_id AND wb_mod_formx_fields .title LIKE '%search%' ) ) ) " string(0) ""
Fatal error: Call to a member function on a non-object in /home/sites/buildmeafabwebsite.co.uk/public_html/search/search.php on line 593
Logged
abidan

Offline Offline

Posts: 102


« Reply #11 on: April 16, 2009, 05:38:02 PM »

its looks like complete garbage to me lol
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #12 on: April 16, 2009, 06:02:04 PM »

Hello,

there is absolutely no problem with formx's SQL-query. It works as expected.
The problem seems to be located in a different module...


Please try this code instead to locate the affected module:
Code:
var_dump($module_name);
// Execute query
$page_query = $database->query($prepared_query." ".$search_path_SQL);
// Loop through queried items

thorn.
Logged

abidan

Offline Offline

Posts: 102


« Reply #13 on: April 16, 2009, 06:03:00 PM »

Hmmmmmmmm, dam, i may have to take off all my modules an reinstall one by one Sad
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #14 on: April 16, 2009, 06:08:36 PM »

No,no. Just try the Code above.
It will show the affected module.

thorn.
Logged

abidan

Offline Offline

Posts: 102


« Reply #15 on: April 16, 2009, 11:03:46 PM »

Oh ok, thanks will try that first thing tomorrow and get back to you, thankyou for taking the time to help me Smiley your a star Smiley
Logged
abidan

Offline Offline

Posts: 102


« Reply #16 on: April 17, 2009, 10:11:45 AM »

Hey

This is what i get:

at the top of hte page:
Notice: Undefined variable: post_id in /home/sites/buildmeafabwebsite.co.uk/public_html/templates/buildme/index.php on line 8

Notice: Undefined variable: post in /home/sites/buildmeafabwebsite.co.uk/public_html/templates/buildme/index.php on line 12

I think this is because i have added some code to the index.php that changes the page titles recently, but i am not sure this is the cause

I then only get Fatal error: Call to a member function on a non-object in /home/sites/buildmeafabwebsite.co.uk/public_html/search/search.php on line 591 in the page section of the search???

Does this help?
Logged
abidan

Offline Offline

Posts: 102


« Reply #17 on: April 17, 2009, 10:13:33 AM »

Arhhhhhhh hang on my bad i get this :


Results For 'search': string(7) "wysiwyg" string(4) "news" string(9) "bookmarks" string(16) "download_gallery" string(Cool "faqmaker" string(5) "formx"
Fatal error: Call to a member function on a non-object in /home/sites/buildmeafabwebsite.co.uk/public_html/search/search.php on line 590

what does that mean?
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #18 on: April 17, 2009, 01:07:29 PM »

Hello,

that is why these kinds of problems are so hard to fix...

It's definitely the formx-module that makes trouble. But - as seen above - the SQL-query itself is pretty fine.

So the reason for this problem is likely located in the formx-related database-tables (thats why it is fixed after deleting the page or after reinstalling the module).

I would need a dump (or just a screenshot) of that tables to see whats going on...
Contact me per PM or eMail if you wish to do more investigations.



thorn.
Logged

thorn

Offline Offline

Posts: 980


WWW
« Reply #19 on: April 19, 2009, 09:03:48 PM »

Hello,

we managed to figure out what the problem was.
It's the cross-join SQL-query style, used by all modules (the "old" search-function).

This query
Code:
SELECT ... FROM wb_mod_formx_fields, wb_mod_formx_settings, wb_pages WHERE ...
leads to a cross-join, which may exceed mySQL's  SQL_MAX_JOIN_SIZE-limit on some servers (depends on the limit itself, the count of pages, the count of formx-fields, and so on).

As a work-around we altered the file search/search.php around line 590

Code:
// Execute query
$page_query = $database->query($prepared_query." ".$search_path_SQL);
if(!$page_query) continue;  // line added
// Loop through queried items


thorn.
Logged

abidan

Offline Offline

Posts: 102


« Reply #20 on: April 19, 2009, 09:08:33 PM »

Cool, thanks workaround is fine by me Smiley Gald to be of help fixing it anyway, if you want me to test anything then let me know Smiley

Cheers
Abi
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!