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.

submit_new_entry field formatting issue

March 09, 2011 1:32pm

Subscribe [2]
  • #1 / Mar 09, 2011 1:32pm

    box-head

    177 posts

    When using the Channel Entries API to submit a new entry, the entry seems to be submitted without any problem.
    However when I view the entry I notice that the field formatting for each custom field is setting to “XHTML”.

    Looking through the exp_channel_data table it seems that for the field formatting columns, nothing is set for any custom fields. Not even the default set for that custom field.

    Here’s my code

    // Load libraries and api's
    $this->EE->load->library('api');
    $this->EE->api->instantiate('channel_fields');
    $this->EE->api_channel_fields->fetch_custom_channel_fields();
    $this->EE->api->instantiate('channel_entries');
    $this->EE->api_channel_fields->settings = array();
    
    $data = array (
        'title' => 'This is a title',
        'entry_date' => '1256954136';
        'field_id_1' => 'This is my summary',
        'field_id_2' => 'This is my body text'
    );
    
    $this->EE->api_channel_entries->submit_new_entry(1, $data);


    I’ve noticed in other forum posts something about the documentation getting updated, but I guess it hasn’t been done yet…

    Any ideas?

  • #2 / Mar 09, 2011 4:57pm

    Sue Crocker

    26054 posts

    Hi, Box-head. That problem is fixed in the EE2.1.4beta, which I can confirm.

    What you’ll need to do is the following:

    1. Convert all the fields you wanted to have be set to None to be XHTML. When prompted, have EE replace all the fields, this will put in xhtml in there. Then convert them back to None, and you should be OK again.

    I know it’s a pain, but it does work.

  • #3 / Mar 10, 2011 5:00am

    box-head

    177 posts

    Hi Sue thanks for the help.
    Any idea when 2.1.4 will come out of beta?

  • #4 / Mar 10, 2011 10:23am

    Sue Crocker

    26054 posts

    Unfortunately I don’t have any idea. But this issue is one I’ll be testing when we get closer to the full release..

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

ExpressionEngine News!

#eecms, #events, #releases