Author Topic: [small bug report] 1.7.3 in ACP  (Read 6477 times)

0 Members and 1 Guest are viewing this topic.

Offline sajwal

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
[small bug report] 1.7.3 in ACP
« on: August 07, 2006, 01:02:53 AM »
Hi,
   This feed back is just to report weather the below lines are some small error i suppose while i try to add category in ACP and if i do not put any field and hit the add button these lines are shown .... actually there should be a valid message to be prompted.

Please recheck the marked fields.


Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\impgal\4images1.7.3\4images\admin\categories.php:546) in C:\wamp\www\impgal\4images1.7.3\4images\admin\admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\impgal\4images1.7.3\4images\admin\categories.php:546) in C:\wamp\www\impgal\4images1.7.3\4images\admin\admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\impgal\4images1.7.3\4images\admin\categories.php:546) in C:\wamp\www\impgal\4images1.7.3\4images\admin\admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\impgal\4images1.7.3\4images\admin\categories.php:546) in C:\wamp\www\impgal\4images1.7.3\4images\admin\admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\impgal\4images1.7.3\4images\admin\categories.php:546) in C:\wamp\www\impgal\4images1.7.3\4images\admin\admin_functions.php on line 172


pls. excuse if its not a bug ... newbie ... :P

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [small bug report] 1.7.3 in ACP
« Reply #1 on: August 07, 2006, 01:44:47 AM »
Thanks for reporting this.
Yes, its a bug (though it doesnt appier on every server, thats why it was unknown untill now ;))

A quick fix is replace in admin/categories.php
Code: [Select]
  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }

  show_admin_header();
With this:
Code: [Select]
  show_admin_header();

  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }

This issue will also be showed if you leave empty fields while editing a category.
Find:
Code: [Select]
  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }
  $cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);

  $sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
          FROM ".CATEGORIES_TABLE."
          WHERE cat_id = $cat_id";
  $cat_row = $site_db->query_firstrow($sql);

  show_admin_header();
Replace with:
Code: [Select]
  show_admin_header();
  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }
  $cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);

  $sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
          FROM ".CATEGORIES_TABLE."
          WHERE cat_id = $cat_id";
  $cat_row = $site_db->query_firstrow($sql);

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sajwal

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [small bug report] 1.7.3 in ACP
« Reply #2 on: August 07, 2006, 05:27:12 PM »
Thanks for reporting this.
Yes, its a bug (though it doesnt appier on every server, thats why it was unknown untill now ;))

A quick fix is replace in admin/categories.php
Code: [Select]
  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }

  show_admin_header();
With this:
Code: [Select]
  show_admin_header();

  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }

This issue will also be showed if you leave empty fields while editing a category.
Find:
Code: [Select]
  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }
  $cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);

  $sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
          FROM ".CATEGORIES_TABLE."
          WHERE cat_id = $cat_id";
  $cat_row = $site_db->query_firstrow($sql);

  show_admin_header();
Replace with:
Code: [Select]
  show_admin_header();
  if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
  }
  $cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);

  $sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
          FROM ".CATEGORIES_TABLE."
          WHERE cat_id = $cat_id";
  $cat_row = $site_db->query_firstrow($sql);


Hello V@no, I did the required changes, but still get the same errors

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [small bug report] 1.7.3 in ACP
« Reply #3 on: August 07, 2006, 05:34:33 PM »
If you did these changes, you would not get the "exact" same errors. Perhaps the changes you've made are not exact as I've posted above.

P.S. since I cant reproduce these errors, we'll need work this thing out together, so please be carefull to what you do ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sajwal

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [small bug report] 1.7.3 in ACP
« Reply #4 on: August 07, 2006, 05:56:04 PM »
If you did these changes, you would not get the "exact" same errors. Perhaps the changes you've made are not exact as I've posted above.

P.S. since I cant reproduce these errors, we'll need work this thing out together, so please be carefull to what you do ;)

Yes It was my mistake ... ERROR FIXED PERFECTLY .. thank you very much  :P