Author |
Message |
bobbyg
Worker


Joined: Dec 05, 2007
Posts: 212
Location: Tampa, Florida
|
Posted:
Thu Feb 28, 2008 8:46 am |
|
When trying to add a new category it creates a record with blank category. Same with sub-category. When trying to validate a new web link get the error of ERROR: You need to type a TITLE for your URL!
even though there is a title in the record. |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Thu Feb 28, 2008 8:50 am |
|
Would this be a news category, Content category, Weblinks category or something else? |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 8:53 am |
|
The web links category in the web links module |
|
|
|
 |
Guardian2003

|
Posted:
Thu Feb 28, 2008 8:59 am |
|
|
|
 |
Guardian2003

|
Posted:
Thu Feb 28, 2008 9:05 am |
|
I have just created a category, then a sub-category of the main ctegory, entered a weblink and am not seeing any problems.
Is this a clean install or an upgrade from a different version of RavenNuke. |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 9:12 am |
|
upgrade. This worked in 2.10. This is first time I tried to add a category, sub category after upgrade. I added category using phpmyadmin and then tried to add link as a user. Link added ok but the validation in the admin section gave me the title error. |
|
|
|
 |
Guardian2003

|
Posted:
Thu Feb 28, 2008 9:28 am |
|
The weblinks table is linked to other tables so trying to insert categories or other data directly into the table isn't a good idea (as you have found) unless you know the relationship of the data to other tables.
I'm assuming you do not have any other data in there as you said this is the first time you have created a category and you cannot add any links until a category is created.
Go back into phpMyAdmin and just remove the row of data from the table - this should get rid of your problem  |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 9:52 am |
|
I only inserted directly into the table when the add category came up with a record with a blank title and I only corrected that blank record.
After your post I:
1 deleted the new category and sub category
2 went to admin to add a main category
3 the add created a new record with a blank title (this will happen with sub cat also) |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 10:01 am |
|
The new category I tried to add was "Education"
The record added to the table has a blank title
But if I go back to the add new category and try to add "Education"
it says it already exists even though the title of the record is blank. |
|
|
|
 |
Guardian2003

|
Posted:
Thu Feb 28, 2008 10:20 am |
|
I'm not sure where you are getting "title" from. That is only use when adding a link but you first have to create a category.
When adding a category you only need to put in the name of the category 'Education' in your case and then the decription of the category after it.
You cannot add a category and a link at the same time as there are two distinct 'submit' buttons which perform two different operations. |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 10:36 am |
|
I know you cannot add a link at the same time. I added a main category, then a sub category, then a link. That is how I used it in 20.10 but the two section below are placing a record in the nuke_links_categories database that is blank.
OpenTable();
echo "<form method=\"post\" action=\"".$admin_file.".php\">"
."<font class=\"option\"><b>" . _ADDMAINCATEGORY . "</b></font><br /><br />"
."" . _NAME . ": <input type=\"text\" name=\"title\" size=\"30\" maxlength=\"100\" /><br />"
."" . _DESCRIPTION . ":<br /><textarea name=\"cdescription\" cols=\"60\" rows=\"10\"></textarea><br />"
."<input type=\"hidden\" name=\"op\" value=\"LinksAddCat\" />"
."<input type=\"submit\" value=\"" . _ADD . "\" /><br />"
."</form>";
CloseTable();
echo "<br />";
// Add a New Sub-Category
$result6 = $db->sql_query("SELECT * from " . $prefix . "_links_categories");
$numrows = $db->sql_numrows($result6);
if ($numrows>0) {
OpenTable();
echo "<form method=\"post\" action=\"".$admin_file.".php\">"
."<font class=\"option\"><b>" . _ADDSUBCATEGORY . "</b></font><br /><br />"
."" . _NAME . ": <input type=\"text\" name=\"title\" size=\"30\" maxlength=\"100\" /> " . _IN . " ";
$result7 = $db->sql_query("SELECT cid, title, parentid from " . $prefix . "_links_categories order by parentid,title");
echo "<select name=\"cid\">";
while($row7 = $db->sql_fetchrow($result7)) {
$cid2 = intval($row7['cid']);
$ctitle2 = stripslashes($row7['title']);
$parentid2 = intval($row7['parentid']);
if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
echo "<option value=\"$cid2\">$ctitle2</option>";
}
echo "</select><br />"
."" . _DESCRIPTION . ":<br /><textarea name=\"cdescription\" cols=\"60\" rows=\"10\"></textarea><br />"
."<input type=\"hidden\" name=\"op\" value=\"LinksAddSubCat\" />"
."<input type=\"submit\" value=\"" . _ADD . "\" /><br />"
."</form>";
CloseTable();
echo "<br />";
} else {
} |
|
|
|
 |
Guardian2003

|
Posted:
Thu Feb 28, 2008 10:51 am |
|
Sorry I just don't have the time to look at this any further today and I am not able to repoduce the problem on my two test sites. |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 11:03 am |
|
Thanks for trying Guardian -- I was hoping someone new of some type of change that would have caused this. I did not activate shortlinks -- and that was the only change that I could think of that would have any effect on web_links. |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Thu Feb 28, 2008 11:19 am |
|
Strange - on my test site, it keeps try to add a category or subcategory called Projects - regardless of what I enter at the cat / subcat title. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
kguske

|
Posted:
Thu Feb 28, 2008 11:38 am |
|
Something's clobbering the title variable, but I can't see how when comparing 2.20 to 2.10.01.
I did find another issue that affects searches, but not adding categories. |
|
|
|
 |
kguske

|
Posted:
Thu Feb 28, 2008 11:58 am |
|
OK. Some progress. I removed an include of a NukeProject file from my test site, and was able to duplicate the blank title. Definitely something outside the module is messing with the variable. Maybe related to dynamic titles? Let me turn that off and see what happens. |
|
|
|
 |
kguske

|
Posted:
Thu Feb 28, 2008 12:08 pm |
|
Found!
Something in my NukeProject admin files was overwriting the $title variable. When I renamed the modules/Projects/admin directory to admin2 and retested, the problem went away.
So, bobbyg, what additional modules do YOU have loaded? (that explains why Guardian doesn't see it - because his test site only include the included modules - the same reason why we didn't catch it during testing).
Let me see if I can come up with a solution that allows other modules to be used without impacting web_links. I would also bet the same it true for downloads... |
|
|
|
 |
kguske

|
Posted:
Thu Feb 28, 2008 12:13 pm |
|
Here's the offending code in modules/Project/admin/links.php:
Code:list($title, $admins) = $db->sql_fetchrow($query);
|
Here's the whole file:
Code:<?php
/********************************************************/
/* NukeProject(tm) */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2005 by NukeScripts Network */
/********************************************************/
global $admin_file;
if(!$admin_file OR $admin_file == "") { $admin_file = "admin"; }
if(!defined('ADMIN_FILE')) { die("Illegal Access Detected!!!"); }
$modname = $pj_config['location'];
$aid = substr($aid, 0,25);
$query = $db->sql_query("SELECT `title`, `admins` FROM `".$prefix."_modules` WHERE `title`='$modname'");
list($title, $admins) = $db->sql_fetchrow($query);
$db->sql_freeresult($query);
$query2 = $db->sql_query("SELECT `name`, `radminsuper` FROM `".$prefix."_authors` WHERE `aid`='$aid'");
list($rname, $radminsuper) = $db->sql_fetchrow($query2);
$db->sql_freeresult($query2);
$admins = explode(",", $admins);
$auth_user = 0;
for($i=0; $i < sizeof($admins); $i++) { if($rname == $admins[$i] AND !empty($admins)) { $auth_user = 1; } }
if($radminsuper == 1 || $auth_user == 1) {
adminmenu($admin_file.".php?op=PJMain", _PJ_TITLE, "nukeproject.png");
}
?>
|
Unfortunately, the variable is populated - but isn't used (i.e. it doesn't need to be modified in this file). Still, it's easier to "fix" web_links to avoid this than to try to identify all possible scenarios of additional addons that cause this same problem... |
|
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Thu Feb 28, 2008 12:34 pm |
|
Is this file included on every page load or something? How does code in another module affect web_links? |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 1:09 pm |
|
kguske wrote: | Found!
Something in my NukeProject admin files was overwriting the $title variable. When I renamed the modules/Projects/admin directory to admin2 and retested, the problem went away.
So, bobbyg, what additional modules do YOU have loaded? (that explains why Guardian doesn't see it - because his test site only include the included modules - the same reason why we didn't catch it during testing).
Let me see if I can come up with a solution that allows other modules to be used without impacting web_links. I would also bet the same it true for downloads... |
That is the problem. I had added work request & probe successfully. The work project did not work and caused other problems so I did not complete the installation of it until I could look into it further. So apparently it is causing more problems with web link also. |
|
|
|
 |
kguske

|
Posted:
Thu Feb 28, 2008 1:29 pm |
|
It's code in the admin file of another module, which gets loaded when displaying the links admin page.
Here is a Only registered users can see links on this board! Get registered or login! for the web_links admin (modules/Web_Links/admin/index.php).
I tested most functions, but want others to test before I add to SVN. |
|
|
|
 |
Gremmie

|
Posted:
Thu Feb 28, 2008 2:02 pm |
|
Oh I see. Yeah, duh. I hate that Nuke admin architecture of running through everybody's case and links files all the time. Stoooopid. |
|
|
|
 |
bobbyg

|
Posted:
Thu Feb 28, 2008 2:02 pm |
|
That solved the problem I was having with web links.
Now I can try and figure what is wrong with projects. |
|
|
|
 |
kguske

|
Posted:
Thu Feb 28, 2008 2:06 pm |
|
I believe the problem would have occurred with adding links, changing categories and links, etc., so I changed quite a few things. Please test everything related to links admin. |
|
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Thu Feb 28, 2008 2:56 pm |
|
|
|
 |
|