We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Error on deleting multiple entries

Development and Programming

Filip Vanderstappen's avatar
Filip Vanderstappen
16 posts
14 years ago
Filip Vanderstappen's avatar Filip Vanderstappen

Bug tracker link

You get the following error when you try to delete multiple entries in the control panel.

Fatal error: Unsupported operand types in expressionengine/libraries/api/Api_channel_entries.php on line 557

It only seems to happen when you try to delete entries that are added via the API.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
14 years ago
John Henry Donovan's avatar John Henry Donovan

Hi Filip,

Have you any add-ons installed?

Is this a fresh install or an upgrade from a previous version or build?

Have you done any import of data at any stage?

Can you explain with context and examples how you added entries through the API please so we can try and replicate?

       
David Hyland's avatar
David Hyland
210 posts
13 years ago
David Hyland's avatar David Hyland

Hi there,

I too have this issue when deleting multiple entries (where some are CP created and some are API created)

Fatal error: Unsupported operand types in /system_uam/expressionengine/libraries/api/Api_channel_entries.php on line 557

The API entries are added thus:

$channel_id = 1;
$data = array(
 'title'         => $result['club_name'],
 'entry_date'    => $this->EE->localize->now,
 'author_id'    => $member_id,
 'status'    => 'Pending',
 'field_id_1'    => '1', 
 'field_ft_1'    => 'none',
 'field_id_7'   => '1', 
 'field_ft_7'   => 'none'
);

if($channel_id && is_array($data))
{
 $this->EE->load->library('api');
 $this->EE->api->instantiate('channel_entries');
 $this->EE->api->instantiate('channel_fields');
 $this->EE->api_channel_fields->setup_entry_settings($channel_id, $data);
 if($this->EE->api_channel_entries->submit_new_entry($channel_id, $data) === FALSE)
 {
  return FALSE;
 }
 else
 {
  return $this->EE->api_channel_entries->entry_id;
 }
}

My EE is v2.5.2 (20120606)

Fieldtypes used with this Channel are: Text, Date, ALT MultiField and REEgion Select with a custom Status Group

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hey David,

What field types are ids 1 and 7? Are those the Multified and REEgion?

Where are you running your API calls? In an add-on or in a template?

Cheers,

       
David Hyland's avatar
David Hyland
210 posts
13 years ago
David Hyland's avatar David Hyland

Hey Dan,

1 and 7 are regular text inputs (I’m not populating any 3rd party fieldtypes via the API so I suppose it could be the default settings of one or more of the 3rd party fieldtypes that’s causing the issue).

The API call is via a custom module.

Cheers

David

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hi David,

Are those fields you aren’t posting to marked as required?

I’ve used the API in a custom module before and didn’t has a problem deleting the entries afterwards.

I could move this off to Development and Programming for some insight?

Cheers,

       
David Hyland's avatar
David Hyland
210 posts
13 years ago
David Hyland's avatar David Hyland

Dan, no they’re not required fields.

It’s not causing any major problems as the entries do delete, it’s just falling over before the stats are updated. But if anyone else can replicate this I would be interested to know.

Cheers!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.