vmichnowicz / hierarchy

CodeIgniter library to assist with hierarchal data such as threaded comments, drop down menus, and nested product categories.
http://hierarchy.vmichnowicz.com/
15 stars 5 forks source link

Delete with children error #1

Open bananapapa opened 11 years ago

bananapapa commented 11 years ago

Hi! Thank you for yout solution. It's really good job. But i found error when deleting item has children:

 Message: Undefined variable: table
 Filename: models/hierarchy_model.php
 Line Number: 318

 Error Number: 1102
 Incorrect database name ' ON '
 SELECT * FROM (`hierarchy`) JOIN ` ON `.`hierarchy_id` = `hierarchy`.`hierarchy_id`                          WHERE `parent_id` = '17' ORDER BY `hierarchy_order` DESC LIMIT 1
 Filename: ..../models/hierarchy_model.php
 Line Number: 847

There are no error when deleting item doesn't has children items.

vmichnowicz commented 11 years ago

This code is super old and looking back some of it is kinda embarrassing. Haha. Anyway, I have make a small patch which should fix this issue.