WeBid Bug Tracking

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000172WeBidAdmin Control Panelpublic2010-12-29 12:002011-02-17 16:34
Reporteraaron 
Assigned To 
Priority@0@SeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.0.0 
Target VersionFixed in Version1.0.1 
Summary0000172: Deleting categories
DescriptionVersion 1.0.0

  While deleting categories via the admin web interface either the category will not delete or you will get redirected to the public error page. If its to the error page then you will

find that the entire category table has been wiped and need to be restored.



 I have been able to reproduce this consistently.



 In my install I have removed all categories and I am currently only using 3-4
TagsNo tags attached.
import_id174
Thread
Attached Files

- Relationships

-  Notes
(0000414)
aaron (reporter)
2010-12-29 12:00
edited on: 1970-01-01 00:00

Version 1.0.0
  While deleting categories via the admin web interface either the category will not delete or you will get redirected to the public error page. If its to the error page then you will
find that the entire category table has been wiped and need to be restored.

 I have been able to reproduce this consistently.

 In my install I have removed all categories and I am currently only using 3-4
(0000415)
auma (reporter)
2010-12-29 20:52
edited on: 1970-01-01 00:00

Aaron,

I have exactly the same problem and I am unable to sell because of it. How did you restore the categories table?
(0000417)
Don Norris (reporter)
2010-12-31 09:01
edited on: 1970-01-01 00:00

I have the same issue. I was setting up categories and then decided to delete a couple. When I did, the system asked me if I really wanted to delete the categories. When I selected yes, I got the error page. Any link to do with categories gets the error page. Would appreciate tips on how to fix the broken table as I know next to nothing about phpMyAdmin.
(0000418)
Lunkwill (reporter)
2010-12-31 17:19
edited on: 1970-01-01 00:00

If you don't have a backup of your database (in which case all you have to do is cut out the part that restores the categories table with an editor and paste it into phpMyAdmin), you can only restore the original categories. You'll find them in install/sql/dump.inc.php. Below the line
# Dumping data for table `" . $DBPrefix . "categories`
there are some queries, being pieced together in PHP. Takes some search-and-replace to transform them back into pure SQL, but that's all you have to paste.

On a sidenote, I have to say the whole SQL buisiness in WeBid is an awful mess.
Today I found this in includes/messages.inc.php:
[PHP]$query = "UPDATE " . $DBPrefix . "users SET language = '" . $_GET['lan'] . "' WHERE id = " . $user->user_data['id'];[/PHP]
If one should run this on a server with PHP magic_quotes disabled, horrors lurk here:
http://site.com/?lan=',password='foo'%20where%20id=1;--[/CODE] [^]
Fortunately, this query is never executed anyway m(
But the same thing can be found in many places. In fact the messages in error.log after the wiped table got me to look at it in the first place.
(0000419)
chronic (viewer)
2011-01-01 15:07
edited on: 2011-01-01 15:08

I have the same issue is there a way to make the admin page function as intended?
(0000420)
Lunkwill (reporter)
2011-01-01 17:19
edited on: 2011-01-01 22:01

chronic wrote

I have the same issue is there a way to make the admin page function as intended?

Edit: bull, misunderstood the question ;) I'll have a look at it but don't hang your hopes too high, I don't really have a clue about the code ...

Edit2:
Seems line 119 in includes/functions_categories.php is the culprit.:[PHP]$query = "DELETE FROM " . $DBPrefix . "categories WHERE left_id >= " . $a['left_id'] . " AND right_id <= " . $a['right_id'];[/PHP]
the SELECT on line 107 selects the level column but its value isn't being used. Now this is completely untested (I'm going to the beach now ;)---gonna do some more hacking tonight) but I'd say it has to look like this:

[Edit3:no, forget the solution. I still haven't properly understood the purpose of left_id and right_id]
(0000421)
Don Norris (reporter)
2011-01-02 03:03
edited on: 1970-01-01 00:00

Hi again
I've reinstalled latest version but this time with the default categories. Because of the admin issue trashing categories table, I'm wondering if in the meantime someone can tell me how to manually edit/delete categories in phpMyAdmin. I'm so totally unfamiliar with php and SQL stuff that it will need to be a pretty simple step by step in my case. FWIW, I tried changing a couple category names in the categories table but, though nothing broke, the changed names don't appear in the menus... clearly not understanding something pretty darn basic!
(0000422)
aaron (reporter)
2011-01-02 16:51
edited on: 1970-01-01 00:00

I use navicat for mysql to edit tables. If you have phpmyadmin it will work for you as well.
After the first time this happened I had just installed a fresh copy of web with a new db prefix and copied the
table back into my live db. Since then I keep a good backup of the tables before messing with the categories.
(0000423)
aaron (reporter)
2011-01-02 16:53
edited on: 1970-01-01 00:00

Don, I had the same problem, make sure your directory permissions are all correct in your languaage files.
ie language/EN dir
(0000428)
Box Lot (reporter)
2011-01-05 16:12
edited on: 1970-01-01 00:00

Anyone who has commented on replicating this issue also needs to click the "Are you able to reproduce this bug?" button.

This is the only way to visually track Bugs and suggestions (with the implement button). Unconfirmed Bugs will likely not be reviewed by Renlok.
(0000434)
shlandau (reporter)
2011-01-06 15:04
edited on: 2011-01-06 15:08

I'm having similar issues via the Admin Panel (Ver. 1.0.0):
1) When I delete a singular item (with no. children), the delete item processes but does not delete it from the SQL table nor from the Categories in the Admin Panel.
2) When I delete two or more singular items at the same level (with no children), the entire SQL table gets cleaned out resulting in the error page. Must re-install original SQL table from that point.
3) When I delete a family (Parent & child), again, the entire SQL table gets cleaned out resulting in the error page. Must re-install original SQL table from that point.

This is my experiencing... and I see that there has been no fixes to-date. So I have been manually manipulating the SQL Database and backing it up often! I'm not a programmer, so I wouldn't be able to provide advice on how to fix this issue.

Box Lot, I'm replying to this post but don't see the option to check off to which you are referring.
(0000435)
Box Lot (reporter)
2011-01-06 18:02
edited on: 1970-01-01 00:00

Under the original posting "Are you able to reproduce this bug - Yes/No"
(0000437)
shlandau (reporter)
2011-01-06 19:50
edited on: 1970-01-01 00:00

Got it!! Thanks
(0000450)
Theodis Butler (viewer)
2011-01-09 23:40
edited on: 2011-01-10 00:13

How to fix Delete All Categories Bug [SOLVED]
So you checked all the boxes and deleted all the categories, eh? I did the same thing.

Luckily I save all downloads in /usr/src

I just unzipped the download and fetched the following values from the dump.inc.php file in the install folder.

Insert at least this record into your categories table:

INSERT INTO `webid`.`webid_categories` (`cat_id`, `parent_id`, `left_id`, `right_id`, `level`, `cat_name`, `sub_counter`, `counter`, `cat_colour`, `cat_image`) VALUES ('1', '-1', '1', '400', '-1', 'All', '0', '0', '', '');

Now everything is happy again.

DEVELOPERS: It should be noted that the languages/EN/categories.inc.php file does not get "wiped"
(0000455)
shlandau (reporter)
2011-01-12 15:48
edited on: 1970-01-01 00:00

I tried this.. didn't work for me... Created additional problems and I had to reload the entire DB.
(0000460)
renlok (administrator)
2011-01-17 14:27
edited on: 1970-01-01 00:00

Sorry to have taken so long to get to this been really busy
in categories.php line 130 replace
[php] $names[] = $row['cat_name'] . '<input type="hidden" name="delete[' . $row['id'] . ']" value="delete">';
                if ($row['COUNT'] > 0 || $row['left_id'] != ($row['right_id'] - 1))
                {
                    $message .= '<tr>';
                    $message .= '<td>' . $row['cat_name'] . '</td><td>';
                    $message .= '<select name="delete[' . $row['id'] . ']">';
                    $message .= '<option value="delete">' . $MSG['008'] . '</option>';
                    $message .= '<option value="move">' . $MSG['840'] . ': </option>';
                    $message .= '</select>';
                    $message .= '</td>';
                    $message .= '<td><input type="text" size="5" name="moveid[' . $row['id'] . ']"></td>';
                    $message .= '</tr>';
                    $counter++;
                }[/php]
with
[php]if ($row['COUNT'] > 0 || $row['left_id'] != ($row['right_id'] - 1))
                {
                    $names[] = $row['cat_name'];
                    $message .= '<tr>';
                    $message .= '<td>' . $row['cat_name'] . '</td><td>';
                    $message .= '<select name="delete[' . $row['cat_id'] . ']">';
                    $message .= '<option value="delete">' . $MSG['008'] . '</option>';
                    $message .= '<option value="move">' . $MSG['840'] . ': </option>';
                    $message .= '</select>';
                    $message .= '</td>';
                    $message .= '<td><input type="text" size="5" name="moveid[' . $row['cat_id'] . ']"></td>';
                    $message .= '</tr>';
                    $counter++;
                }
                else
                {
                    $names[] = $row['cat_name'] . '<input type="hidden" name="delete[' . $row['cat_id'] . ']" value="delete">';
                }[/php]

Also in a bit im going to update the SVN & make a update patch were you can get the fix.

@Lunkwill:
Yeah some of the code is still pretty iffy thats mainly the original code from phpauction GPL which hasn't been fixed yet if you find anything else it would be great if you could give me heads up about it :) Also the left_id & right_id are related to where the category is in relation to the other categories. The categories are set up in a data tree so it takes up less resources to use them when it gets pretty big, its the The Nested Set Model from http://dev.mysql.com/tech-resources/articles/hierarchical-data.html[/url] [^]
(0000467)
bid4abook (reporter)
2011-01-18 12:03
edited on: 1970-01-01 00:00

I have had this probelm as well, I will try the fix and report back. Regards John.
(0000538)
pryc (viewer)
2011-02-17 16:34
edited on: 1970-01-01 00:00

did not helped :/
(0001044)
psmjesus (viewer)
2012-12-13 13:23
edited on: 1970-01-01 00:00

Wow..., been a long time since the the last post...
I found a bug and the solution on this topic. If you've translated the file "messages.inc.php" completely to your language, when trying to delete a category from the table from the admin panel, nothing happens (not clear). This is because the change "YES" of $ MSG ['030 '] = "Yes", does not accept the deletion. So to make it work, you should set it to "YES".
For example, I tried to put $ MSG ['030 '] = "SI" (Spanish) and did not work, and $ MSG ['030'] = "Yes"; works perfectly.

Sorry my bad English.
Regards

- Issue History
Date Modified Username Field Change
2015-04-01 13:17 renlok New Issue
2015-04-01 13:17 renlok import_id => 174
2015-04-01 13:17 renlok Date Submitted 2015-04-01 13:17 => 2010-12-29 12:00
2015-04-01 13:17 renlok Last Update 2015-04-01 13:17 => 2011-02-17 16:34


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker