WordPress.org

Ready to get started?Download WordPress

Forums

Custom Field Suite
[resolved] Javascript error creating new group (7 posts)

  1. Covi
    Member
    Posted 2 years ago #

    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/

  2. logikal16
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. Covi
    Member
    Posted 2 years ago #

    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?

  4. Covi
    Member
    Posted 2 years ago #

    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 (WordPress Network use network_admin_url() instead).

  5. logikal16
    Member
    Plugin Author

    Posted 2 years ago #

    CFS 1.4.5 will include an uninstall hook (to clean up tables and options), as well as the other fixed you mentioned.

    Matt

  6. logikal16
    Member
    Plugin Author

    Posted 2 years ago #

    CFS 1.4.5 has been released.

  7. Covi
    Member
    Posted 2 years ago #

    Thanks! ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic