• Resolved awmax99

    (@awmax99)


    I recently downloaded and installed CPT-onomies. I think it will work perfect for my needs. The problem is I can’t get it to work and it displays 5 error messages when it’s active.

    Strict Standards: Redefining already defined constructor for class CPT_TAXONOMY in D:\WebSites\wp1\wp-content\plugins\cpt-onomies\cpt-onomy.php on line 20

    Strict Standards: Redefining already defined constructor for class CPT_ONOMIES_MANAGER in D:\WebSites\wp1\wp-content\plugins\cpt-onomies\manager.php on line 29

    Strict Standards: Redefining already defined constructor for class CPT_ONOMIES_ADMIN in D:\WebSites\wp1\wp-content\plugins\cpt-onomies\admin.php on line 29

    Strict Standards: Declaration of CPTonomy_Walker_Terms_Checklist::start_el() should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in D:\WebSites\wp1\wp-content\plugins\cpt-onomies\admin.php on line 1196

    Strict Standards: Redefining already defined constructor for class CPT_ONOMIES_ADMIN_SETTINGS in D:\WebSites\wp1\wp-content\plugins\cpt-onomies\admin-settings.php on line 30

    Any help to resolve these would be appreciated.

    Thank you!

    https://www.ads-software.com/plugins/cpt-onomies/

Viewing 5 replies - 1 through 5 (of 5 total)
  • From what I could figure out via Google-fu, this seems to be a PHP class issue with PHP5.

    It looks like the fix is to make sure the PHP5 constructor is BEFORE the PHP4 constructor. In other words, in the cpt-onomy.php file, which holds the CPT_onomy class, this:

    public function CPT_TAXONOMY() { $this->__construct(); }
    public function __construct() {
       // function filters
       add_filter( 'get_terms', array( &$this, 'get_terms' ), 1, 3 );
       add_filter( 'wp_get_object_terms', array( &$this, 'wp_get_object_terms' ), 1, 4 );
       // other filters
       add_filter( 'get_terms_args', array( &$this, 'adjust_get_terms_args' ), 1, 2 );
    }

    needs to be this:

    public function __construct() {
       // function filters
       add_filter( 'get_terms', array( &$this, 'get_terms' ), 1, 3 );
       add_filter( 'wp_get_object_terms', array( &$this, 'wp_get_object_terms' ), 1, 4 );
       // other filters
       add_filter( 'get_terms_args', array( &$this, 'adjust_get_terms_args' ), 1, 2 );
    }
    public function CPT_TAXONOMY() { $this->__construct(); }

    __construct() is the PHP5 way of doing things while CPT_TAXONOMY(), i.e a function with the name of the class, is the PHP4 method.

    I’ve updated my code for the next update but a quick fix would be to go switch these lines wherever you see the class issue.

    Hope this helps! Thanks!

    Thread Starter awmax99

    (@awmax99)

    That fixed everything except:

    Strict Standards: Declaration of CPTonomy_Walker_Terms_Checklist::start_el() should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in D:\WebSites\wp1\wp-content\plugins\cpt-onomies\admin.php on line 1196

    Thanks again!
    Al

    Try replacing the function declaration for start_el() in the CPTonomy_Walker_Terms_Checklist class in the admin.php file with this:

    function start_el( &$output, $category, $depth = 0, $args = array(), $current_object_id = 0 ) {

    Thread Starter awmax99

    (@awmax99)

    I think that fixed it.

    Thank you for the great support!

    You’re most welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Errors when plugin is active’ is closed to new replies.