adv. search for # comments crashes

Please report bugs here, please be very detailed in your bug reports. If you've come up with some code to fix the bug, please post it here.
Post Reply
stellarfirefly
Noob
Posts: 2
Joined: Sun May 25, 2014 20:43

adv. search for # comments crashes

Post by stellarfirefly »

Description: Performing an Advanced Search with any value(s) in the "Comment count" field results in a crash/exception.

Fix:
class.advkilllist.php
    Line 357: $where[] = "ind_cnt IN (".implode(", ", $involved).")";
...should be:
    Line 357: $where[] = "ind_cnt IN (".implode(", ", $comments).")";
EDIT: Actually, this fix seems to be incorrect. The search will use that number for "pilots involved". I'll let the real developers figure out what is the real fix. :)
Last edited by stellarfirefly on Sun May 25, 2014 20:53, edited 1 time in total.
stellarfirefly
Noob
Posts: 2
Joined: Sun May 25, 2014 20:43

Re: adv. search for # comments crashes

Post by stellarfirefly »

Just for reference, the error it generates:

Error:
[spoiler]WARNING [2] implode(): Invalid arguments passed
Error on line 357 in file /usr/local/kb/mods/advanced_search/class.advkilllist.php
PHP 5.4.4-14+deb7u9 (Linux), EDK 4.2.0.0 (Rubicon 1.3)
File: /usr/local/kb/mods/advanced_search/class.advkilllist.php, line: 357, function: implode
File: /usr/local/kb/mods/advanced_search/class.search.php, line: 115, class: AdvKillList, function: setCommentCount
File: /usr/local/kb/common/includes/class.pageassembly.php, line: 80, function: call_user_func_array
File: /usr/local/kb/common/includes/class.pageassembly.php, line: 37, class: pageAssembly, function: call
File: /usr/local/kb/common/search.php, line: 164, class: pageAssembly, function: assemble
File: /usr/local/kb/common/index.php, line: 303, function: include
File: /usr/local/kb/index.php, line: 27, function: include

Database error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) GROUP BY kills.kll_id ORDER BY kll_timestamp DESC' at line 48
SQL: SELECT SQL_CALC_FOUND_ROWS kills.kll_id as 'ID', kll_timestamp as 'Time', pilots.plt_id as 'Pilot_ID', pilots.plt_name as 'Name', pilots.plt_externalid as 'Pilot_Ext_ID', corps.crp_name as 'Corp', corps.crp_id as 'Corp_ID', alliances.all_name as 'Ally', alliances.all_id as 'Ally_ID', fbpilots.plt_id as 'FB_Pilot_ID', fbpilots.plt_name as 'FB_Name', fbpilots.plt_externalid as 'FB_Pilot_Ext_ID', fbcorps.crp_id as 'FB_Corp_ID', fbcorps.crp_name as 'FB_Corp', fballys.all_id as 'FB_Ally_ID', fballys.all_name as 'FB_Ally', shp_id as 'Ship_ID', itemShips.typeName as 'Ship', itemShips.typeID as 'Ship_ID', scl_class as 'Class', scl_id as 'ClassID', scl_value as 'ShipValue', sys_id as 'System_ID', sys_name as 'System', sys_sec as 'SysSec', kll_dmgtaken as 'Damage', ind_cnt as 'Involved', kll_points as 'KillPoints', kll_external_id as 'ExtID', kll_isk_loss as 'ISK_Loss', count(distinct com.id) as 'Comments' FROM kb3_kills as kills INNER JOIN kb3_pilots AS pilots ON kll_victim_id = pilots.plt_id INNER JOIN kb3_corps AS corps ON kll_crp_id = corps.crp_id INNER JOIN kb3_alliances AS alliances ON kll_all_id = alliances.all_id INNER JOIN kb3_pilots AS fbpilots ON kll_fb_plt_id = fbpilots.plt_id INNER JOIN kb3_inv_detail AS fb ON fb.ind_kll_id = kills.kll_id AND fb.ind_plt_id = kll_fb_plt_id INNER JOIN kb3_corps AS fbcorps ON fbcorps.crp_id = fb.ind_crp_id INNER JOIN kb3_alliances AS fballys ON fballys.all_id = fb.ind_all_id INNER JOIN kb3_ships AS ships ON kll_ship_id = shp_id INNER JOIN kb3_ship_classes AS ship_classes ON shp_class = scl_id INNER JOIN kb3_invtypes AS itemShips ON shp_id = itemShips.typeID INNER JOIN kb3_systems AS systems ON kll_system_id = sys_id INNER JOIN kb3_constellations AS constellations ON sys_con_id = con_id INNER JOIN kb3_regions AS regions ON con_reg_id = reg_id INNER JOIN (SELECT ind_kll_id AS cnt_kll_id, count(*) AS ind_cnt FROM kb3_inv_detail GROUP BY ind_kll_id) AS cnt_kill ON cnt_kll_id = kll_id LEFT JOIN kb3_comments com ON ( kills.kll_id = com.kll_id ) WHERE (ind_cnt IN ()) GROUP BY kills.kll_id ORDER BY kll_timestamp DESC
ERROR [256] SQL error (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) GROUP BY kills.kll_id ORDER BY kll_timestamp DESC' at line 48
Error on line 46 in file /usr/local/kb/common/includes/class.dbnormalquery.php
PHP 5.4.4-14+deb7u9 (Linux), EDK 4.2.0.0 (Rubicon 1.3)
File: /usr/local/kb/common/includes/class.dbnormalquery.php, line: 46, function: trigger_error
File: /usr/local/kb/mods/advanced_search/class.advkilllist.php, line: 534, class: DBNormalQuery, function: execute
File: /usr/local/kb/mods/advanced_search/class.advkilllist.php, line: 674, class: AdvKillList, function: execQuery
File: /usr/local/kb/mods/advanced_search/class.search.php, line: 219, class: AdvKillList, function: getCount
File: /usr/local/kb/common/includes/class.pageassembly.php, line: 80, function: call_user_func_array
File: /usr/local/kb/common/includes/class.pageassembly.php, line: 37, class: pageAssembly, function: call
File: /usr/local/kb/common/search.php, line: 164, class: pageAssembly, function: assemble
File: /usr/local/kb/common/index.php, line: 303, function: include
File: /usr/local/kb/index.php, line: 27, function: include
User avatar
Salvoxia
Developer
Posts: 1598
Joined: Wed Feb 22, 2012 12:11

Re: adv. search for # comments crashes

Post by Salvoxia »

Hi,

thank you for this report.
However, it concerns the mod "Advanced search" and not EDK core itself.
This mod has a number of known issues and a working list of fixes can be found in this post in the mod's thread in the mods sub-forums.
Now we'd just need someone to update the mod :) I'll see what I can do (using it myself on my production board, so shouldn't be a problem).

Regards,
Salvoxia
Post Reply