Title: [Plugin: Custom Field Suite] Javascript error creating new group
Last modified: August 20, 2016

---

# [Plugin: Custom Field Suite] Javascript error creating new group

 *  Resolved [Covi](https://wordpress.org/support/users/covi/)
 * (@covi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/)
 * Add new field button –>
    `Uncaught SyntaxError: Unexpected token ;` because field
   is empty:
 *     ```
       <script type="text/javascript">
       field_index = ;
       ```
   
 * `Uncaught ReferenceError: field_index is not defined` -> file:line fields.js:
   29
 * Temp fix for init errors:
    Initialize vars with defaults values or dump an error
   notice; eg.
 * admin_head.php, line 11
 *     ```
       $field_count = 0;
       $options_html = array(); // For options object
       ```
   
 * PS: I don’t have (or plugin don’t install) the table `{$wpdb->prefix}cfs_fields`
 * [http://wordpress.org/extend/plugins/custom-field-suite/](http://wordpress.org/extend/plugins/custom-field-suite/)

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

 *  [logikal16](https://wordpress.org/support/users/logikal16/)
 * (@logikal16)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677175)
 * Covi,
 * Delete the “cfs_version” option. The plugin will re-create the appropriate tables
   for you. This is likely due to manually deleting the tables after previously 
   uninstalling CFS.
 *     ```
       DELETE FROM wp_options WHERE option_name = 'cfs_version' LIMIT 1;
       ```
   
 * P.S. If this works for you, please reconsider your vote. Thanks.
 *  Thread Starter [Covi](https://wordpress.org/support/users/covi/)
 * (@covi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677326)
 * Thanks Logikal, …I’m not newbie (I know how to edit DB, etc); and I put 5 stars(
   because of POO) to plugin before this.
 * I just think a plugin should check DB tables, directories, initialize vars… An
   uninstalled plugin should delete tables unused. Imagine you had 30 plugins with
   tables that already not in use? 30 dead tables on my DB??
 * I have another example (trying to find this file…) on homepage of plugin: On 
   thickbox, this file uses “wp-admin” directly instead `admin_url('location/')`(
   I’m not using blogurl/wp-admin/).
 * —
    Finally: I think the plugin shouldn’t assume anything. If I need delete my
   old db option of version, the plugin should to do this; if the plugin needs a
   pre-defined var, the plugin should check and setup this; …not the user.
 * PS: Great work anyway; mmm… you don’t have the project on github?
 *  Thread Starter [Covi](https://wordpress.org/support/users/covi/)
 * (@covi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677328)
 * Ok, wp-admin error on `admin-footer.php line 17`:
 * `<?php bloginfo('url'); ?>/wp-admin/plugin-install.php`
    `<?php echo admin_url('
   plugin-install.php'); ?>`
 * —
    `<p><?php _e('See updates for', 'cfs'); ?> <a class="thickbox" href="<?php
   bloginfo('url'); ?>/wp-admin/plugin-install.php?tab=plugin-information&plugin
   =custom-field-suite&section=changelog&TB_iframe=1&width=640&height=480">v<?php
   echo $this->version; ?></a></p>`
 * Fix:
 * `<p><?php _e('See updates for', 'cfs'); ?> <a class="thickbox" href="<?php echo
   admin_url('plugin-install.php'); ?>?tab=plugin-information&plugin=custom-field-
   suite&section=changelog&TB_iframe=1&width=640&height=480">v<?php echo $this->
   version; ?></a></p>`
 * PS: I think the best option is set something like `$this->admin_url` to check
   wp version and setup [admin url](http://codex.wordpress.org/Function_Reference/admin_url)(
   WordPress Network use `network_admin_url()` instead).
 *  [logikal16](https://wordpress.org/support/users/logikal16/)
 * (@logikal16)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677335)
 * CFS 1.4.5 will include an uninstall hook (to clean up tables and options), as
   well as the other fixed you mentioned.
 * Matt
 *  [logikal16](https://wordpress.org/support/users/logikal16/)
 * (@logikal16)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677343)
 * CFS 1.4.5 has been released.
 *  Thread Starter [Covi](https://wordpress.org/support/users/covi/)
 * (@covi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677364)
 * Thanks! 😉

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

The topic ‘[Plugin: Custom Field Suite] Javascript error creating new group’ is 
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Covi](https://wordpress.org/support/users/covi/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-custom-field-suite-javascript-error-creating-new-group/#post-2677364)
 * Status: resolved