Go Back   Pligg CMS Forum > Pligg Development > Bug Report

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2007, 03:28 AM
observer_24_7's Avatar
Pligg Donor
 
Join Date: May 2006
Posts: 45
Thanks: 5
Thanked 3 Times in 2 Posts
Arrow bug in the code. not directly in the feature.

Not sure if this is a bug. But looks like an issue with the code.

In libs/search.php ,

the code is:


if(isset($this->orderBy)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}

When I call it like this .. the this->sql gets multiple ORDER BY in it .. for eg " .... ORDER BY ORDER BY link_vote" ...

So I modified the code to :


if(isset($this->orderBy) && (strstr($this->orderBy, 'ORDER') === false)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}

and it works fine now.

You guys will know best but I think theres a possibility that this->orderBy variable is set multiple times and we get multiple ORDER BY additions to the sql string.



The code I used:

include_once(mnminclude.'search.php');
global $new_search;
$search=new Search();
$search->filterToStatus = 'all';
$search->orderBy = " link_votes ";
$search->doSearch();
$new_search = $search->new_search();
require_once("libs/link_summary.php");
__________________
India Digg : News from users
Reply With Quote
  #2 (permalink)  
Old 02-04-2007, 05:16 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
Can you give us an example sql query in pligg where you noticed there being 2 order by's?
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
  #3 (permalink)  
Old 02-05-2007, 03:28 PM
observer_24_7's Avatar
Pligg Donor
 
Join Date: May 2006
Posts: 45
Thanks: 5
Thanked 3 Times in 2 Posts
Actually I posted the code in my prev post. Its:

The code I used:

include_once(mnminclude.'search.php');
global $new_search;
$search=new Search();
$search->filterToStatus = 'all';
$search->orderBy = " link_votes ";
$search->doSearch();
$new_search = $search->new_search();
require_once("libs/link_summary.php");
__________________
India Digg : News from users
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Method to add Sender Name and Sender Email to Tell-A-Friend feature ablaye Modification Tutorials 0 11-18-2007 12:36 PM
Licensing tbronson Wiki Articles 0 10-27-2007 11:55 PM
Problem with adbrite code empollon General Help 2 07-03-2007 05:57 AM
new category code - improvements? cruci Modification Tutorials 4 01-06-2007 01:35 PM


Search Engine Friendly URLs by vBSEO 3.2.0