Viewing Issue Advanced Details Jump to Notes ] << ] >> ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000142 [phpBBGarage] General minor always 2008-12-02 16:10 2009-06-29 09:23
Reporter Alfredo View Status public  
Assigned To poyntesm
Priority normal Resolution fixed Platform
Status resolved   OS
Projection none   OS Version
ETA none Fixed in Version 2.0.B5 Product Version
  Target Version Product Build
Summary 0000142: Deleting of guestbook comments doesn't work
Description When deleting a guestbook comment, you receive this error:


SQL ERROR [ mysql4 ]

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 'AND v.make_id = mk.id AND v.model_id = md.id AND v.user_id = u.user_' at line 2 [1064]

SQL

SELECT v.*, ROUND(v.weighted_rating, 2) as weighted_rating, images.*, mk.make, md.model, v.made_year, mk.make, md.model, count(mods.id) AS total_mods, ( SUM(mods.price) + SUM(mods.install_price) ) AS total_spent, u.username, u.user_avatar_type, u.user_avatar, u.user_id, u.user_avatar_width, u.user_avatar_height, u.user_colour, u.user_id FROM (phpbb3_garage_vehicles v, phpbb3_garage_makes mk, phpbb3_garage_models md, phpbb3_users u) LEFT JOIN phpbb3_garage_modifications mods ON (mods.vehicle_id = v.id) LEFT JOIN phpbb3_garage_vehicles_gallery vg ON (v.id = vg.vehicle_id AND vg.hilite = 1) LEFT JOIN phpbb3_garage_images images ON (images.attach_id = vg.image_id) WHERE v.id = AND v.make_id = mk.id AND v.model_id = md.id AND v.user_id = u.user_id GROUP BY v.id

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal->sql_error()

FILE: includes/mods/class_garage_vehicle.php
LINE: 1826
CALL: dbal_mysql->sql_query()

FILE: garage_guestbook.php
LINE: 86
CALL: garage_vehicle->get_vehicle()
Steps To Reproduce
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000307)
Alfredo (reporter)
2008-12-18 10:05

As of SVN 674, the error goes away though you still can't delete the comments (nothing happens).
(0000316)
Beda (reporter)
2009-04-09 15:38

I did not get your SQL error but after cliking on X button page reloaded and nothing happened, comment was still there. Therefore I checked code of garage_guestbook.php and replaced

This:
        $params = array('comment_id' => '');
        $data = $garage->process_vars($params);

        /**
        * Perform required DB work to delete comment
        */
        $garage->delete_rows(GARAGE_GUESTBOOKS_TABLE, 'id', $data['comment_id']);



With this:
// $params = array('comment_id' => '');
// $data = $garage->process_vars($params);

        /**
        * Perform required DB work to delete comment
        */
        $garage->delete_rows(GARAGE_GUESTBOOKS_TABLE, 'id', $comment_id);

and deletion of comments in guestbook is working now :-)

PS: I'm not sure if I did it right way because I'm newbie in PHP and SQL things but it's working LOL
(0000330)
poyntesm (administrator)
2009-06-29 09:23

Yes, you are correct it can be done that way.. I did it small different but idea is same :) Fixed locally now.

- Issue History
Date Modified Username Field Change
2008-12-02 16:10 Alfredo New Issue
2008-12-18 10:05 Alfredo Note Added: 0000307
2009-04-09 15:38 Beda Note Added: 0000316
2009-06-29 09:23 poyntesm Status new => resolved
2009-06-29 09:23 poyntesm Fixed in Version => 2.0.B5
2009-06-29 09:23 poyntesm Resolution open => fixed
2009-06-29 09:23 poyntesm Assigned To => poyntesm
2009-06-29 09:23 poyntesm Note Added: 0000330
cron