ok I have 7.7 installed with patch 3 and i recently installed sentinal. For some reason I can't add or edit categories. It says "this category already exists". not sure whats going on.
I read a post in regards to 7.0 that says that you have to edit admin/modules/stories.php which is not there. I did look at modules/news/admin/index.php not sure if this is what I need to edit but the code looks similar. here's the code
Quote:
function SaveEditCategory($catid, $title) {
global $prefix, $db, $admin_file;
$title = ereg_replace("\"","",$title);
$result = $db->sql_query("select catid from ".$prefix."_stories_cat where title='$title'");
$catid = intval($catid);
$check = $db->sql_numrows($result);
if ($check) {
$what1 = _CATEXISTS;
$what2 = _GOBACK;
} else {
$what1 = _CATSAVED;
$what2 = "[ <a href=\"".$admin_file.".php\">"._GOTOADMIN."</a> ]";
$result = $db->sql_query("update ".$prefix."_stories_cat set title='$title' where catid='$catid'");
if (!$result) {
return;
}
}
Thanks in advance for any help
arnoldkrg Major
Joined: Aug 03, 2003
Posts: 936
Location: United Kingdom
Posted:
Fri Sep 02, 2005 11:09 pm
I have just discovered what appears to be a bug in the News module. I discovered this in a Nuke 7.7 patched 3.1 site but it may exist in an unpatched version. When you try to add a category the bug causes the category to be saved as News and not the category you tried to add. So when you next try to add another category, it again tries to save it as News (but that already exists because that is what the last category was saved as) and so it tells you that the category already exists.
The Bug will also cause any changes to the Category title to be saved as News when editing a category.
Here is an example of the bug at work when you try to add a category.
Right at the beginning of modules/News/admin/index.php you will find the following:
Code:
$query = $db->sql_query("SELECT title, admins FROM ".$prefix."_modules WHERE title='$module_name'");
list($title, $admins) = $db->sql_fetchrow($query);
This assigns the value News to $title and no matter which value of $title was passed to index.php, it will be reassigned the value News.
When we add a category the name of the Title field for the category is title thus:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum