Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,557
    Plugin Contributions
    28

    Default Object of class Directory could not be converted to string

    I just upgraded our server to PHP 5.2.6 and did install the new html_output.php files but I'm getting this error when I try to edit a product in the admin

    Catchable fatal error: Object of class Directory could not be converted to string in /home/ccu/public_html/shop/jNk699/includes/modules/product/collect_info.php on line 548

    Line 548 is the echo line below:

    <?php
    $dir1 = @dir(DIR_FS_CATALOG_IMAGES."/FlashImage");
    echo $dir1;
    ?>

    This is part of a custom mod to our cart but the developer is MIA.

    Any suggestions??

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Object of class Directory could not be converted to string

    dir() returns an object to $dir1, so you need to use the appropriate methods in that object to access the data stored inside it.

    A dir() object uses a "read" method, so, in the case of your "echo $dir1" statement, you could render it differently as such:
    Code:
    echo $dir1->read();
    For more info, read up on the syntax and documentation at www.php.net

    (To get the entire folder's directory listing, you'd need to loop through all the $dir1 object's values, typically using a WHILE loop. Examples of this can be found on the php.net site.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,557
    Plugin Contributions
    28

    Default Re: Object of class Directory could not be converted to string

    You rock!! I was hoping it was simple...simple for someone who understood the coding.

    Can I get you a cup of coffee?!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Object of class Directory could not be converted to string

    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,557
    Plugin Contributions
    28

    Default Re: Object of class Directory could not be converted to string

    I appreciate the help. This is the second cup this week. Linda (Ajeh) got one on Monday too!

 

 

Similar Threads

  1. Replies: 6
    Last Post: 13 Jul 2016, 01:05 PM
  2. Replies: 1
    Last Post: 24 Oct 2009, 09:09 PM
  3. PayPal Push Orders: Object of class shoppingCart could not be converted to string
    By honrheart in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Oct 2009, 03:58 PM
  4. Object of class psigate_xml could not be converted to string
    By james739 in forum Addon Payment Modules
    Replies: 3
    Last Post: 19 Jun 2009, 04:20 PM
  5. Coupon Restrict: Object of class queryFactoryResult could not be converted to string
    By DodgeGirl in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 4 Mar 2009, 10:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR