Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Call to a member function on a non-object error..


awarner20

Recommended Posts

Posted

Hello everyone,

 

When I log into Admin and click on Catalog-->Manufacturers, I receive this error "Fatal error: Call to a member function on a non-object in /home/content/a/w/a/myusername/html/admin/manufacturers.php on line 196"

 

I opened manufacturers.php and line 196 begins like this...

 

<td class="smallText" valign="top"><?php echo $manufacturers_split->display_count($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS); ?></td>
				<td class="smallText" align="right"><?php echo $manufacturers_split->display_links($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>

 

Would anyone here be able to offer me advice on what direction to look to find the cause (or the fix) for this error?

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Posted
Hello everyone,

 

When I log into Admin and click on Catalog-->Manufacturers, I receive this error "Fatal error: Call to a member function on a non-object in /home/content/a/w/a/myusername/html/admin/manufacturers.php on line 196"

 

I opened manufacturers.php and line 196 begins like this...

 

<td class="smallText" valign="top"><?php echo $manufacturers_split->display_count($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS); ?></td>
				<td class="smallText" align="right"><?php echo $manufacturers_split->display_links($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>

 

Would anyone here be able to offer me advice on what direction to look to find the cause (or the fix) for this error?

It's not instantiating the $manufacturers_split as a split_page_results class, so the ->display_count is failing because it's trying to call a function that's a member of that class, on an item that's not an object of that class... Check your code to make sure there's like a $manufacturers_query_raw = 'select blahblahblah whatever' and then a $manufacturers_split = new splitPageResults($manufacturers_query_raw, etc, etc)... That's the general design of those calls... If it's not calling a new splitpageresults, or if it's commented out, that would be the reason why... If you can't resolve this yourself, then on your next post, try to post that file for us to take a look at and we'll see if we can find where to put the fix at :)

 

Richard.

Richard Lindsey

  • 2 weeks later...
Posted
It's not instantiating the $manufacturers_split as a split_page_results class, so the ->display_count is failing because it's trying to call a function that's a member of that class, on an item that's not an object of that class... Check your code to make sure there's like a $manufacturers_query_raw = 'select blahblahblah whatever' and then a $manufacturers_split = new splitPageResults($manufacturers_query_raw, etc, etc)... That's the general design of those calls... If it's not calling a new splitpageresults, or if it's commented out, that would be the reason why... If you can't resolve this yourself, then on your next post, try to post that file for us to take a look at and we'll see if we can find where to put the fix at :)

 

Richard.

 

 

Hi Richard,

 

Sorry it took so long to reply, I missed the topic reply notification of your response. Thank you for such a detailed and explanatory answer. I was able to go through the code and indeed the following line had been commented out by accident.

 

 $manufacturers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $manufacturers_query_raw, $manufacturers_query_numrows);

 

It was on the same line as the //EOF of some Header Tag Controller code. I moved it to it's own line and viola!

 

Thanks again!

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...