Answers.Body: <p>Fixing this will require a change to the Civi-WP plugin. In the meantime, put the following code on a new line below the one that reads <code>$screen = get_current_screen();</code> which should be at line 164 of 'civicrm.shortcodes.modal.php'.</p>
  
  <pre><code>if ( ! isset( $screen-&gt;post_type ) ) return;
  </code></pre>
  
  <p>That should mean your fields are saved again.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-06T11:18:48.837Z
Answers.Text: Perfect.  Thank you!
Answers.UserDisplayName: twowheeler
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T15:43:49.713Z
Answers.LastActivityDate: 2015-10-05T15:43:49.713Z
Answers.UserDisplayName: Christian Wach
Body: <p>In wordpress, when setting up a ninja form text block I get the following error. It shows up next to the "Add Media" button so I assume that it is trying to add a Civicrm button and fails.</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object in /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.shortcodes.modal.php on line 170 Call Stack: 0.0000 239040 1. {main}() /var/www/wordpress/wp-admin/admin-ajax.php:0 0.1404 4172272 2. do_action() /var/www/wordpress/wp-admin/admin-ajax.php:89 0.1404 4173800 3. call_user_func_array() /var/www/wordpress/wp-includes/plugin.php:503 0.1404 4173944 4. ninja_forms_new_field() /var/www/wordpress/wp-includes/plugin.php:503 0.1940 4190192 5. ninja_forms_return_echo() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/ajax.php:193 0.1940 4207304 6. call_user_func_array() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/functions.php:7 0.1940 4207768 7. ninja_forms_edit_field() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/functions.php:7 0.1941 4207952 8. do_action() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/edit-field.php:6 0.1941 4209592 9. call_user_func_array() /var/www/wordpress/wp-includes/plugin.php:503 0.1941 4209760 10. ninja_forms_edit_field_output_li() /var/www/wordpress/wp-includes/plugin.php:503 0.1958 4214568 11. nf_output_registered_field_settings() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/li.php:123 0.1987 4218784 12. ninja_forms_edit_field_el_output() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/li.php:419 0.1993 4221088 13. wp_editor() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/edit-field.php:132 0.1995 4230840 14. _WP_Editors::editor() /var/www/wordpress/wp-includes/general-template.php:2565 0.2024 4238472 15. do_action() /var/www/wordpress/wp-includes/class-wp-editor.php:222 0.2096 4250120 16. call_user_func_array() /var/www/wordpress/wp-includes/plugin.php:503 0.2096 4250272 17. CiviCRM_For_WordPress_Shortcodes_Modal->add_form_button() /var/www/wordpress/wp-includes/plugin.php:503 0.2096 4250344 18. CiviCRM_For_WordPress_Shortcodes_Modal->post_type_has_button() /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.shortcodes.modal.php:101</p>
  </blockquote>
  
  <p>It prevents the text field from being saved in the form.  In this case I don't need any civicrm processing in the form so it does not need to be there but I don't know how to remove it.  Has anyone dealt with this before?</p>
  
  <p>Versions: Wordpress 4.3.1, Civicrm 4.6.8, Ninja forms 2.9.28</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-04T13:29:58.817Z
Comments.Text: Can you add the versions of WordPress, CiviCRM and Ninja Forms?
Comments.UserDisplayName: Kevin Cristiano
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-05T15:39:29.313Z
Comments.Text: Interesting. So it's the wp_editor() function that's triggering the error on an admin screen that has no post type set.
Comments.UserDisplayName: Christian Wach
Tags: <wordpress><forms>
Title: Does CiviCRM work with Ninja Forms?
ThreadText: # Does CiviCRM work with Ninja Forms?
  
  (Asked by: username_0 on 2015-10-04)
  
  In wordpress, when setting up a ninja form text block I get the following error. It shows up next to the "Add Media" button so I assume that it is trying to add a Civicrm button and fails.
  
  > Notice: Trying to get property of non-object in /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.shortcodes.modal.php on line 170 Call Stack: 0.0000 239040 1. {main}() /var/www/wordpress/wp-admin/admin-ajax.php:0 0.1404 4172272 2. do\_action() /var/www/wordpress/wp-admin/admin-ajax.php:89 0.1404 4173800 3. call\_user\_func\_array() /var/www/wordpress/wp-includes/plugin.php:503 0.1404 4173944 4. ninja\_forms\_new\_field() /var/www/wordpress/wp-includes/plugin.php:503 0.1940 4190192 5. ninja\_forms\_return\_echo() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/ajax.php:193 0.1940 4207304 6. call\_user\_func\_array() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/functions.php:7 0.1940 4207768 7. ninja\_forms\_edit\_field() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/functions.php:7 0.1941 4207952 8. do\_action() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/edit-field.php:6 0.1941 4209592 9. call\_user\_func\_array() /var/www/wordpress/wp-includes/plugin.php:503 0.1941 4209760 10. ninja\_forms\_edit\_field\_output\_li() /var/www/wordpress/wp-includes/plugin.php:503 0.1958 4214568 11. nf\_output\_registered\_field\_settings() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/li.php:123 0.1987 4218784 12. ninja\_forms\_edit\_field\_el\_output() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/li.php:419 0.1993 4221088 13. wp\_editor() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/edit-field.php:132 0.1995 4230840 14. \_WP\_Editors::editor() /var/www/wordpress/wp-includes/general-template.php:2565 0.2024 4238472 15. do\_action() /var/www/wordpress/wp-includes/class-wp-editor.php:222 0.2096 4250120 16. call\_user\_func\_array() /var/www/wordpress/wp-includes/plugin.php:503 0.2096 4250272 17. CiviCRM\_For\_WordPress\_Shortcodes\_Modal->add\_form\_button() /var/www/wordpress/wp-includes/plugin.php:503 0.2096 4250344 18. CiviCRM\_For\_WordPress\_Shortcodes\_Modal->post\_type\_has\_button() /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.shortcodes.modal.php:101
  
  It prevents the text field from being saved in the form. In this case I don't need any civicrm processing in the form so it does not need to be there but I don't know how to remove it. Has anyone dealt with this before?
  
  Versions: Wordpress 4.3.1, Civicrm 4.6.8, Ninja forms 2.9.28
  
  **Tags:** wordpress, forms
  
  > **Comments:**
  > **username_1**: Can you add the versions of WordPress, CiviCRM and Ninja Forms?  
  > **username_2**: Interesting. So it's the wp_editor() function that's triggering the error on an admin screen that has no post type set.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-10-05. Score: 2
  
  Fixing this will require a change to the Civi-WP plugin. In the meantime, put the following code on a new line below the one that reads `$screen = get_current_screen();` which should be at line 164 of 'civicrm.shortcodes.modal.php'.
  
  ```
  if ( ! isset( $screen->post_type ) ) return;
  
  ```
  
  That should mean your fields are saved again.
  
  > **Comments:**
  > **username_0**: Perfect.  Thank you!  
  
  ---
  
  