ThorntonStuart / SimpleCloner

An entry cloning module compatible with EE3
5 stars 3 forks source link

Module Outputs Array of Errors when save_entry fails #9

Open joelcollyer opened 7 years ago

joelcollyer commented 7 years ago

In ext.simple_cloner.php, errors in the entry are being printed to the page: $errors = ee()->api_channel_entries->get_errors(); print_r($errors);

We're seeing that come up when the editor failed to populate a required field: Array ( [Field Name] => The following field is required: )

Any help here would be very much appreciated.

ThorntonStuart commented 7 years ago

Hi Joel. I can remove the print statement but if it is a required field then entry saving shouldn't work anyway as far as I understand the default EE behaviour? Is the issue that Simple Cloner is additionally alerting you or that the entry won't save?

joelcollyer commented 7 years ago

Hey! Thanks for getting back to me. We are able to save this entry normally, but not clone it, and I think it's because Simple Cloner isn't able to validate relationship fields.

The exp_channel_data table has a column for each relationship field (which is never used as far as I can tell), the data is stored in the exp_relationships table instead, so we're getting a "field is required" error no matter what's been filled in.