Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help - catalog down. Urgent help needed


bettie_hemlock

Recommended Posts

I am getting this error when I try to add a new product into my catalog.

 

Warning: reset(): Passed variable is not an array or object in /home/.nathaniel/fpress/flesh-press.com/store/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/.nathaniel/fpress/flesh-press.com/store/admin/includes/classes/object_info.php on line 18

 

If I try to edit an existing product, everything is blanked out on the preview page

 

 

Recently I've added an about me page and the comodo ssl contribution but I have rolled back the comodo contribution (by restoring my file backups). I have tried rolling back my database after this problem arose but to no avail.

 

I looked at a virgin copy of object_info.php and it is the same as the working copy.

 

All the products can still be viewed on my site I just can't add to them or modify them. I'm tearing my hair out. Please help! :)

 

Thanks,

 

Ingrid

Link to comment
Share on other sites

The problem isn't in object_info.php, it's in what is calling the objectInfo function, or something that is causing an empty argument to be passed.

 

I'm going to take a SWAG (perhaps not so WA because I've seen vaguely similar symptoms before). Did you recently edit your .htaccess file in the site root, to add rewrite rules? Back out those changes. (Or, as an experiment, rename .htaccess.)

 

What I think is happening is that a rewrite rule is throwing away the HTTP_POST_VARS content which is used when you do much of anything in admin.

Link to comment
Share on other sites

Thanks for the help.

 

I haven't changed the .htaccess file and it appears non-existent in my web root dir. This may be because I don't have access to it (I use a hosted server) or because there is some other way they are handling it. I know I can change access through my control panel and when I added an .htaccess file before it messed everything up. I will ask my host if they have made changes or something because I haven't touched the permissions at all for a long time.

Link to comment
Share on other sites

Thanks for the help.

 

I haven't changed the .htaccess file and it appears non-existent in my web root dir. This may be because I don't have access to it (I use a hosted server) or because there is some other way they are handling it. I know I can change access through my control panel and when I added an .htaccess file before it messed everything up. I will ask my host if they have made changes or something because I haven't touched the permissions at all for a long time.

 

 

post removed

 

 

F5

Link to comment
Share on other sites

Have you edited ANY .htaccess files - such as in your catalog directory?

 

No, I haven't :/ I haven't changed anything to do with permissions at all (not since my initial setup, and even then it wasn't using .htaccess files). The only things I changed were the files in the comodo mod, then I undid the changes (file manips, no db changes). It had been working for a couple of months already and now suddenly it doesn't work. It's very strange.

Link to comment
Share on other sites

Well, what you're going to have to do is add some diagnostic code in categories.php to figure out what is going wrong. You need to identify which call to objectInfo is the problem and add a print_r function call to display what is supposed to be the argument. It takes some detective work and trying this and that to work out what the cause of the problem is.

 

Does your catalog side work ok? Can you do an "add to cart" for example?

Link to comment
Share on other sites

I can add things to a cart but when I try to login I get the error:

 

Warning: Division by zero in /home/.nathaniel/fpress/flesh-press.com/store/includes/classes/shipping.php on line 61

 

Warning: Division by zero in /home/.nathaniel/fpress/flesh-press.com/store/includes/classes/shipping.php on line 62

 

No price for shipping is shown. If I go through the checkout, the proper price for items is shown but no shipping is charged. The order does come through to the admin tool.

 

I had tried just earlier to change the "maximum I would ship" in the store configuration to 20. I pressed edit and now it is blanked out. I didn't get an error message though.

 

I am just trying to think of the fastest way to get this fixed. I have a print ad for my store coming out this week in a magazine and this issue has meant that I couldn't finish in time to be functional. I guess at least orders still come through.

 

Could I reinstall oscommerce in another directory, move my images across then restore my database? I don't have any database mods installed at the moment.

 

I have a sinking feeling that this problem may be hard to track down.

Link to comment
Share on other sites

I had tried just earlier to change the "maximum I would ship" in the store configuration to 20. I pressed edit and now it is blanked out. I didn't get an error message though.

 

 

 

This could possibly cause both errors - run through the editing process carefully and it should retain a value.

 

Matti

Link to comment
Share on other sites

Your problem sounds just like the one I saw earlier. Please post the .htaccess from your catalog folder, and if different, from your top-level web folder (where your site homepage is.)

Link to comment
Share on other sites

Okay, here is my .htaccess file. I had a bout of dumb and couldn't find it before. It's from my catalog/admin folder, catalog is named store though.

 

AuthType Basic

AuthUserFile /home/fpress/flesh-press.com/store/admin/.htpasswd

AuthName "Store Administration"

require valid-user

RewriteEngine  on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^https?://(www\.)?flesh-press.com/?.*$ [NC]

RewriteRule \.(gif|jpg|jpeg|png|mp3|mpg|avi|mov)$ - [F]

 

I hope this helps :)

 

Thanks everyone for helping me! I really appreciate it.

Link to comment
Share on other sites

Did you delete the .htaccess in the catalog folder? (Or wherever you have your index.php) There is one there by default. Please look again.

 

Comment out the Rewrite lines by inserting a # at the beginning and see what happens.

Link to comment
Share on other sites

Progress! :)

 

Okay I commented out the rewrite lines in the .htaccess file and I added the default .htaccess file, from a clean installation file I had, to the catalog (store) folder, it had everything commented out except the following lines:

 

<IfModule mod_setenvif.c>

  <IfDefine SSL>

    SetEnvIf User-Agent ".*MSIE.*" \

            nokeepalive ssl-unclean-shutdown \

            downgrade-1.0 force-response-1.0

  </IfDefine>

</IfModule>

 

Now I am not getting the error message anymore when I try to edit a product, it simply gives me a blank page and blanks out all of the information about the product, i.e. title, description and the price.

 

I am able to login now without getting an error message however.

Link to comment
Share on other sites

Oops, made a mistake in my last post. Yes, I do still get the error message when I try to add a new product.

 

Warning: reset(): Passed variable is not an array or object in /home/.nathaniel/fpress/flesh-press.com/store/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/.nathaniel/fpress/flesh-press.com/store/admin/includes/classes/object_info.php on line 18

 

Editing an exisiting product makes it all blank out and the checkout process still gets this error

Warning: Division by zero in /home/.nathaniel/fpress/flesh-press.com/store/includes/classes/shipping.php on line 61

 

Warning: Division by zero in /home/.nathaniel/fpress/flesh-press.com/store/includes/classes/shipping.php on line 62

on the Delivery Confirmation page of the checkout (checkout_shipping.php).

Link to comment
Share on other sites

At this point you'll need to add some debugging code to see what is going wrong. If you'd like me to help you with this, send me a Private Message with the FTP server name and login information for your site (you may want to create a temporary FTP username.)

 

Something is still stripping out all of the form information.

Link to comment
Share on other sites

Your problem was, as I suspected, a redirect. You have a site-wide redirect that takes an incoming URL with a www. prefix and redirects to the URL without the www. By itself, this would be harmless. But you also had your configure.php for your admin set up so that the HTTP_SERVER had www in the URL.

 

osC species the "action" of the form tag to be the full URL of the given page, based on HTTP_SERVER. It may also add some "get" parameters after a ?. But when this URL had the WWW, the redirect caused the "post" parameters, such as text fields, to be dropped.

 

The fix was to make the HTTP_SERVER field avoid the redirect by not including the www.

 

This problem had some side-effects in your store - it would have blanked out any configuration field you tried to update, and this wreaks havoc in the rest of your site, for example, causing zerodivide errors on the shipping page.

 

The odd thing was that I was unable to locate a .htaccess file on your site that did this redirect. It may be some "control panel" setting for your host.

 

Hope things are going better for you now.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...