CalderaWP / caldera-custom-fields

Save Caldera Forms submissions in a post type or use Caldera Forms to create custom metaboxes.
https://calderaforms.com/downloads/caldera-form-custom-fields/
7 stars 11 forks source link

Images are attatched twice if featured #17

Closed Shelob9 closed 7 years ago

Shelob9 commented 7 years ago

cf_custom_fields_attach_file() does attatching, but so does Caldera Forms itself.

Shelob9 commented 7 years ago

This is only going to work if Caldera Forms 1.5.0.9-b-1 or later is in use, else old behaviour applies. Thsi is beacuse I needed the change in https://github.com/CalderaWP/Caldera-Forms/issues/1516

Close via d43aa6f

andrewlimaza commented 7 years ago

@Shelob9 tested this with 1.5.0.9 and issue still exists if images uploaded to 'Save as Post Type' and the file is set as custom fields (not assigned to any field).

Shelob9 commented 7 years ago

Still an issue after 569964f if the image is set to attach to media library and featured image

Shelob9 commented 7 years ago

Conceptual problem:

We're using caldera_forms_render_setup_field to set media library option false for featured image, which would work, IF cf_handle_file_upload() were called via plugins API. Which I like totally thaguht was the case beacuse: https://github.com/CalderaWP/Caldera-Forms/blob/master/includes/field_processors.php#L30-L31

But it's actually called via the upload handler https://github.com/CalderaWP/Caldera-Forms/blob/master/classes/core.php#L3417 so that filter isn't applied, #FML nothing we can do in this add-on can fix that.

Shelob9 commented 7 years ago

Close via https://github.com/CalderaWP/Caldera-Forms/commit/a53ca7541aabc499d06e6069aa11602046b0055b and https://github.com/CalderaWP/caldera-custom-fields/commit/29f0fb9bc95fb22c2267b73ff07c670954e22bcb