Title: Error returned from AJAX when WP_DEBUG enabled.
Last modified: August 30, 2016

---

# Error returned from AJAX when WP_DEBUG enabled.

 *  Resolved [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/)
 * Notice: Undefined index: bcc_to in \wp-content\plugins\caldera-forms\classes\
   Caldera_Forms_Save_Final.php on line 189
 * [https://wordpress.org/plugins/caldera-forms/](https://wordpress.org/plugins/caldera-forms/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493017)
 * Also found that the JSON success response gets corrupted with an error in WooCommerce,
   though that may be unrelated.
 *  Thread Starter [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493018)
 * Here is the patch I wrote for the first error.
 * Changed
 *     ```
       // if added a bcc
       		$bcc_to = trim( $form['mailer']['bcc_to'] );
       		if( !empty( $bcc_to ) ){
       			$mail['headers'][] = Caldera_Forms::do_magic_tags( 'Bcc: ' . $bcc_to );
       		}
   
       		// if added a replyto
       		$reply_to = trim( $form['mailer']['reply_to'] );
       		if( !empty( $reply_to ) ){
       			$mail['headers'][] = Caldera_Forms::do_magic_tags( 'Reply-To: <' . $reply_to . '>' );
       		}
       ```
   
 * To
 *     ```
       // if added a bcc
       		if( !empty( $form['mailer']['bcc_to'] ) ){
       			$bcc_to = trim( $form['mailer']['bcc_to'] );
       			$mail['headers'][] = Caldera_Forms::do_magic_tags( 'Bcc: ' . $bcc_to );
       		}
   
       		// if added a replyto
       		if( !empty( $form['mailer']['reply_to'] ) ){
       			$reply_to = trim( $form['mailer']['reply_to'] );
       			$mail['headers'][] = Caldera_Forms::do_magic_tags( 'Reply-To: <' . $reply_to . '>' );
       		}
       ```
   
 *  Thread Starter [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493019)
 * Other than that though gonna add Caldera Forms to our officially support form
   plugins to use with Popup Maker.
 *  Plugin Author [Josh Pollock](https://wordpress.org/support/users/shelob9/)
 * (@shelob9)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493343)
 * Can you please submit this as a pull request? [https://github.com/desertsnowman/caldera-forms](https://github.com/desertsnowman/caldera-forms)
 *  [npal.radhika](https://wordpress.org/support/users/npalradhika/)
 * (@npalradhika)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493353)
 * Daniel, how and where could I apply the patch ?
 *  Plugin Author [Josh Pollock](https://wordpress.org/support/users/shelob9/)
 * (@shelob9)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493362)
 * The underlying issue here is now fixed in CF 1.0.3.1
 *  Thread Starter [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493363)
 * [@josh](https://wordpress.org/support/users/josh/) Pollock – Awesome to hear.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error returned from AJAX when WP_DEBUG enabled.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/caldera-forms_475846.svg)
 * [Caldera Forms - More Than Contact Forms](https://wordpress.org/plugins/caldera-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/caldera-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/caldera-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/caldera-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/caldera-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/caldera-forms/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/error-returned-from-ajax-when-wp_debug-enabled/#post-6493363)
 * Status: resolved