CurlyWillow1 Posted January 18, 2009 Share Posted January 18, 2009 Hi, New to OScomerce, and have installed the latest version. I am not able to access the administration tool. I get the following error: Fatal error: Class messagestack: Cannot inherit from undefined class tablebox in /home/content/c/u/r/curlywillow/html/catalog/admin/includes/classes/message_stack.php on line 20 I have tried a few things, thinking it is just a script change but not sure exactly where. Can any one help? Link to comment Share on other sites More sharing options...
satish Posted January 18, 2009 Share Posted January 18, 2009 make sure class for tablebox is there in Your code. Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does. Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 18, 2009 Author Share Posted January 18, 2009 make sure class for tablebox is there in Your code. Satish In what code should I be looking in? Link to comment Share on other sites More sharing options...
germ Posted January 18, 2009 Share Posted January 18, 2009 Look for this code in /admin/includes/application_top.php // setup our boxes require(DIR_WS_CLASSES . 'table_block.php'); require(DIR_WS_CLASSES . 'box.php'); // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; Looks to me like the class the error is on: class messageStack extends tableBlock { Is defined in require(DIR_WS_CLASSES . 'table_block.php'); class tableBlock { If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 18, 2009 Author Share Posted January 18, 2009 Look for this code in /admin/includes/application_top.php // setup our boxes require(DIR_WS_CLASSES . 'table_block.php'); require(DIR_WS_CLASSES . 'box.php'); // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; Looks to me like the class the error is on: class messageStack extends tableBlock { Is defined in require(DIR_WS_CLASSES . 'table_block.php'); class tableBlock { Where should I find these codes: class messageStack extends tableBlock { Is defined in require(DIR_WS_CLASSES . 'table_block.php'); class tableBlock { Link to comment Share on other sites More sharing options...
germ Posted January 18, 2009 Share Posted January 18, 2009 Focus on application_top.php Does it, or does it not have the code I posted, in that order? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 18, 2009 Author Share Posted January 18, 2009 Focus on application_top.php Does it, or does it not have the code I posted, in that order? :unsure: I do not see those three codes after: // setup our boxes require(DIR_WS_CLASSES . 'table_block.php'); require(DIR_WS_CLASSES . 'box.php'); // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; Here is how the code is for a few lines: // setup our boxes require(DIR_WS_CLASSES . 'table_block.php'); require(DIR_WS_CLASSES . 'box.php'); // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; // split-page-results require(DIR_WS_CLASSES . 'split_page_results.php'); // entry/item info classes require(DIR_WS_CLASSES . 'object_info.php'); // email classes require(DIR_WS_CLASSES . 'mime.php'); require(DIR_WS_CLASSES . 'email.php'); // file uploading class require(DIR_WS_CLASSES . 'upload.php'); // calculate category path if (isset($HTTP_GET_VARS['cPath'])) { $cPath = $HTTP_GET_VARS['cPath']; } else { $cPath = ''; } Link to comment Share on other sites More sharing options...
germ Posted January 18, 2009 Share Posted January 18, 2009 Looks OK to me. I have no clue. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
germ Posted January 18, 2009 Share Posted January 18, 2009 Check the contents of /admin/includes/classes/table_block.php It should look something like this: <?php /* $Id: table_block.php 1745 2007-12-21 02:29:49Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class tableBlock { var $table_border = '0'; var $table_width = '100%'; var $table_cellspacing = '0'; var $table_cellpadding = '2'; var $table_parameters = ''; var $table_row_parameters = ''; var $table_data_parameters = ''; function tableBlock($contents) { $tableBox_string = ''; $form_set = false; if (isset($contents['form'])) { $tableBox_string .= $contents['form'] . "\n"; $form_set = true; array_shift($contents); } $tableBox_string .= '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"'; if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; $tableBox_string .= '>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { $tableBox_string .= ' <td'; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; $tableBox_string .= '</td>' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . $contents[$i]['align'] . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; } $tableBox_string .= ' </tr>' . "\n"; } $tableBox_string .= '</table>' . "\n"; if ($form_set == true) $tableBox_string .= '</form>' . "\n"; return $tableBox_string; } } ?> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 18, 2009 Author Share Posted January 18, 2009 Here is how it appears for me: <?php /* $Id: table_block.php 1745 2007-12-21 02:29:49Z hpdl $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ class tableBlock { var $table_border = '0'; var $table_width = '100%'; var $table_cellspacing = '0'; var $table_cellpadding = '2'; var $table_parameters = ''; var $table_row_parameters = ''; var $table_data_parameters = ''; function tableBlock($contents) { $tableBox_string = ''; $form_set = false; if (isset($contents['form'])) { $tableBox_string .= $contents['form'] . "\n"; $form_set = true; array_shift($contents); } $tableBox_string .= '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"'; if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; $tableBox_string .= '>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { $tableBox_string .= ' <td'; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; $tableBox_string .= '</td>' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . $contents[$i]['align'] . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; } $tableBox_string .= ' </tr>' . "\n"; } $tableBox_string .= '</table>' . "\n"; if ($form_set == true) $tableBox_string .= '</form>' . "\n"; return $tableBox_string; } } ?> Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 18, 2009 Author Share Posted January 18, 2009 OK, Well have deleted every thing and started over and reinstalled. Still have the same problem. Wondering if has anything to do with upgrades to the "administration tool". Thank for the help! Link to comment Share on other sites More sharing options...
germ Posted January 18, 2009 Share Posted January 18, 2009 Post the first 30 lines from /catalog/admin/includes/classes/message_stack.php If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 18, 2009 Author Share Posted January 18, 2009 The first 30 lines from /catalog/admin/includes/classes/message_stack.php: <?php /* $Id: message_stack.php 1740 2007-12-20 14:57:13Z hpdl $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2002 osCommerce Released under the GNU General Public License Example usage: $messageStack = new messageStack(); $messageStack->add('general', 'Error: Error 1', 'error'); $messageStack->add('general', 'Error: Error 2', 'warning'); if ($messageStack->size('general') > 0) echo $messageStack->output('general'); */ class messageStack extends tableBox { // class constructor function messageStack() { global $messageToStack; $this->messages = array(); if (tep_session_is_registered('messageToStack')) { for ($i=0, $n=sizeof($messageToStack); $i<$n; $i++) { $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']); } tep_session_unregister('messageToStack'); } } Link to comment Share on other sites More sharing options...
germ Posted January 18, 2009 Share Posted January 18, 2009 I think this line: class messageStack extends tableBox { Should be: class messageStack extends tableBlock { If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
CurlyWillow1 Posted January 19, 2009 Author Share Posted January 19, 2009 I think this line: class messageStack extends tableBox { Should be: class messageStack extends tableBlock { Nice catch! It worked I am in! Hope this helps others as well. Thanks lots! :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.