Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning on front page


Subbie

Recommended Posts

Hi

I am new to oscommerce and have successfully installed latest version.

Have added a new module by duplicating manufacturers successfully except for one issue. When entering store front end the following appears:

Warning: substr() expects parameter 2 to be integer, string given in 

This arises from the code:

while ($authors = tep_db_fetch_array($authors_query)) {
            $authors_name = ((strlen($authors['authors_name']) >

MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, (Appears to be error line)

MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
            $authors_array[] = array('id' => $authors['authors_id'],
                                           'text' => $authors_name);
          }

This is exactly the same as is being used in manufacturer's code, which is working in the module for manufacturers.

Can anyone help to through light on a solution. I have tried changing the '0' at the end of the line but it simply changes the error to a different number. Online has not helped as the solutions do not work.

Any help would be very much appreciated.

Subbie

 

 

Link to comment
Share on other sites

Quote

have successfully installed latest version.

What do you mean by "latest version"? If it's the official 2.3.4.1 version, it's years out of date and will not run on current PHP levels. Since you're just starting out, remove that installation and use the real latest version, osC 2.3.4.1BS Edge/CE/Frozen (from GitHub). See my signature for how to get it. And what PHP version are you running? It needs to be a current version (at least, 5.6) for the Edge version to run.

Link to comment
Share on other sites

39 minutes ago, Subbie said:

Have added a new module by duplicating manufacturers successfully except for one issue.

Clearly not if your having issues 😊 Simply copying the existing module is not sufficent. You need to make sure you have the required tables in your db for your new module.

Post the full warning or a link to your site to allow full debuging. Or zip your modified code here so someone can check it.

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...