ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

More PHP Errors using Safecracker Edit Form

May 17, 2011 6:57pm

Subscribe [4]
  • #1 / May 17, 2011 6:57pm

    goldnmean

    4 posts

    This question may be related to a resolved thread.

    EE Version: 2.1.3
    Build: 20110411
    Safecracker: 2.0.0

    I am getting these errors when using Safecracker Edit Form yet it seems that the updated edited data is being written correctly to the database:

    A PHP Error was encountered
    Severity: Notice
    Message: Array to string conversion
    Filename: libraries/Functions.php
    Line Number: 1429
    
    A PHP Error was encountered
    Severity: Notice
    Message: Array to string conversion
    Filename: libraries/Functions.php
    Line Number: 1429
    
    A PHP Error was encountered
    Severity: Notice
    Message: Array to string conversion
    Filename: libraries/Functions.php
    Line Number: 1429
    
    A PHP Error was encountered
    Severity: Warning
    Message: Cannot modify header information - headers already sent by (output started at /home/www/public_html/domain/admin/codeigniter/system/core/Exceptions.php:170)
    Filename: libraries/Functions.php
    Line Number: 749
    
    A PHP Error was encountered
    Severity: Warning
    Message: Cannot modify header information - headers already sent by (output started at /home/www/public_html/domain/admin/codeigniter/system/core/Exceptions.php:170)
    Filename: libraries/Functions.php
    Line Number: 387

    Here is my Safecracker SAEF code:

    {exp:safecracker channel="products" return="bees/bees" url_title="{segment_3}"}
     
            <label for="title">Title</label>
            <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100"><br >
    
            <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
    
            <input type="hidden" name="entry_date" id="entry_date" value="{entry_date}" maxlength="23" size="25" />
            
            <label for="common_name">Common Name</label>
            <select name="common_name" id="common_name">
                {options:common_name}
                <option value="{option_value}"{selected}>{option_name}</option>
                {/options:common_name}
            </select>
    
            
            <label for="scientific_name">Scientific Name</label>
            <select name="scientific_name" id="scientific_name">
                {options:scientific_name}
                <option value="{option_value}"{selected}>{option_name}</option>
                {/options:scientific_name}
            </select>
    
            
            <label for="origin">Origin</label>
            <select name="origin" id="origin">
                {options:origin}
                <option value="{option_value}"{selected}>{option_name}</option>
                {/options:origin}
            </select>
    
    
            <label for="grade">Grade</label>
            <select name="grade" id="grade">
                {options:grade}
                <option value="{option_value}"{selected}>{option_name}</option>
                {/options:grade}
            </select>
    
                    
            <label for="males">Males</label>
            <input type="text" name="males" id="males" value="{males}" /><br >
        
            <label for="females">Females</label>
            <input type="text" name="females" id="females" value="{females}" /><br >
                    
            <label for="shipping">Shipping Cost</label>
            <input type="text" name="product_shipping" id="product_shipping" value="{product_shipping}" /><br >
            
            <label for="price">Price</label>
            <input type="text" name="product_price" id="product_price" value="{product_price}" /><br >
                    
            <input type="submit" name="submit" value="Submit" />
    
    {/exp:safecracker}
  • #2 / May 18, 2011 9:49am

    Sue Crocker

    26054 posts

    Hi, goldnmean.

    If you switch to use the entry_id instead of the url_title, does that make a difference?

    entry_id="{segment_3}"
  • #3 / May 18, 2011 11:54am

    goldnmean

    4 posts

    Makes no difference.  Already tried that.  Exact same errors with either url_title or entry_id.

  • #4 / May 19, 2011 6:50am

    John Henry Donovan

    12339 posts

    goldnmean,

    Do you have relationship type fields for this channel? A quick search brought up this thread and this one

  • #5 / May 23, 2011 7:34pm

    goldnmean

    4 posts

    No relationships.  Yeah I read the other threads but I have these errors without relationship fields.

  • #6 / May 24, 2011 12:35pm

    Sue Crocker

    26054 posts

    Hi, goldnmean..

    What I’d do is reduce the complexity of your form to just the basics, just the css needed for SafeCracker. Make sure that works.

    If it does, add in another element until you figure out which one is causing the problem.

  • #7 / May 24, 2011 1:21pm

    goldnmean

    4 posts

    I have done this already.  I have stripped down the form to 1 field and still get the errors.  The form works fine on generating a new entry and even writes the correct data to all the fields on edit but gives me the php errors on edit instead of redirecting.

  • #8 / May 25, 2011 3:13pm

    Brandon Jones

    5500 posts

    goldnmean,

    Can you show us the 1-field form that is still generating errors, so we’re on the same page?

  • #9 / May 25, 2011 3:22pm

    goldnmean

    4 posts

    Did a complete reinstall of EE and database.  This didn’t entirely fix it.  Guys at BarrettNewton helped me out.  I was using some CartThrob tags and on the return page it was giving me some errors in libraries/evalmath.php file because I had blank values.  Problem is fixed now!

  • #10 / May 25, 2011 4:47pm

    Brandon Jones

    5500 posts

    Nice! Glad you were able to find the culprit, and thanks for posting the solution. Don’t hesitate with any other questions!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases