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.

Safecracker php error

March 15, 2011 12:51pm

Subscribe [3]
  • #1 / Mar 15, 2011 12:51pm

    lonelytraveller

    38 posts

    Hello,
    I’m trying to use a very simple safecracker form to let my users create their entries without accessing the CP. The problem is that when I click the “submit” button I get some php errors. However the entry is safely stored and I can see it in the back end.

    I’m using EE 2.1.3 (Build 20101220).

    This is my form:

    {exp:safecracker 
        channel="blog" 
        return="SAEF/thankyou" 
        entry_id="{segment_3}"
        rules:body="required|min_length[5]"    
        id="safecracker" 
        error_handling="inline"
    }
        <div>
            <label for="title">Title</label>
    
            <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100">
        </div>
        <div>
            <label for="url_title">URL Title</label>
    
            <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
        </div>
        <div>
            <label>Body</label>
    
            <textarea name="body" id="body" class="markitup" cols="50" rows="30" value="{body}" ></textarea>
        </div>
        <div>
            <label for="entry_date">Date</label>
    
            <input type="text" name="entry_date" id="entry_date" value="{entry_date}" maxlength="23" size="25" />
        </div>
        <div>
         {category_menu}
            <label for="categories">Categories</label>
    
            <select name="category[]" id="categories" size="4" multiple="multiple">
            {select_options}
            </select>
        {/category_menu} 
        </div>
        <input type="submit" name="submit" value="Submit" />
    
    {/exp:safecracker}

    Here’s the error reporting:

    A PHP Error was encountered
    
    Severity: Warning
    
    Message: implode() [function.implode]: Invalid arguments passed
    
    Filename: pt_multiselect/ft.pt_multiselect.php
    
    Line Number: 67
    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Uninitialized string offset: 0
    
    Filename: tagger/ft.tagger.php
    
    Line Number: 222
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Cannot modify header information - headers already sent by (output started at /Users/username/my_sites_folder/project/sys/codeigniter/system/core/Exceptions.php:170)
    
    Filename: libraries/Functions.php
    
    Line Number: 387

    I don’t know if this is relevant, but I’m testing my install locally using MAMP, my sys folder is above the webroot, and I’m using Structure. The publish form in the back-end contains a Playa and a Matrix field, but as you can see the safecracker form contains just some basic EE fields.

    I don’t know much about php, so I don’t really know what’s happening. Is there anyone who could give me a hint?

    Edit: Maybe I should add that Php version is 5.2.13

  • #2 / Mar 16, 2011 7:35am

    John Henry Donovan

    12339 posts

    lonelytraveller,

    If you examine your errors you will see that they reference 2 third-party fieldtypes.
    P&T’s Multiselect and Tagger?
    Do you have them installed?


    Try adding safecracker_head=“no” as a parameter and see what happens

  • #3 / Mar 16, 2011 9:06am

    lonelytraveller

    38 posts

    Hi John, Tagger and P&T Multiselect are installed and work perfectly, and a Tagger field is used in the Blog channel publish form, but not a P&T Multiselect field.

    Adding the safecracker_head=“no” parameter had no effect, I get the same php errors as before.
    If I switch php error reporting off in MAMP preferences the form works and the user is redirected to the courtesy page (the one I set up as a parameter in safecracker tag). But php error reporting is there for a reason, so switching it off is just a workaround.

  • #4 / Mar 16, 2011 4:21pm

    Sue Crocker

    26054 posts

    I left a note on the Tagger forum asking if they tested SafeCracker with Tagger. If you don’t have the tagger field in there, does the SC form work as expected?

    Thread: http://www.devdemon.com/forums/viewthread/508/

  • #5 / Mar 16, 2011 6:40pm

    lonelytraveller

    38 posts

    Thanks Sue, I’ve bookmarked the thread on the Tagger forum. I’ll try to remove the tagger field and post the result here.

  • #6 / Mar 17, 2011 7:28am

    lonelytraveller

    38 posts

    I’ve removed the tagger field and the php error related to tagger disappeared. But the P&T field error is still there. Maybe I forgot to point out that we’re using just one field group for, then we just show/hide the fields we need in the publish form, so the P&T field is indeed there, even if it’s not visible in the publish form. Maybe that php warning has something to do with that?

  • #7 / Mar 17, 2011 4:29pm

    Sue Crocker

    26054 posts

    Possibly - I haven’t ever tested with P&T multiple select. Does is work as expected inside of EE’s control panel? Are you on the most recent version of P&T multiple select?

  • #8 / Mar 19, 2011 11:23am

    lonelytraveller

    38 posts

    Just to be sure I had the latest version I downloaded and installed P&T Multiselect again, but I still have the same problem.
    Strangely, when I see the php error page, if I go back to the safecracker form (by simply clicking on the “back” button in browser), change the title and url field in the form and submit it again, then Php errors disappear.

  • #9 / Mar 19, 2011 5:37pm

    lonelytraveller

    38 posts

    I’ve just managed to transfer the site to our staging server, which has a different PHP Version (5.2.15), and this time no errors.

  • #10 / Mar 21, 2011 5:27am

    John Henry Donovan

    12339 posts

    Excellent. Closing this thread for now. Feel free to start anew thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases