Support » Plugin: Improve My City » Error when creating a new status in backend

  • Resolved flachzange

    (@flachzange)


    On a clean install with 1.4.1 and WP 4.9.6 the following warning/error occurs in case you create a new status in the backend:

    Warning: Parameter 1 to end() expected to be a reference, value given in /www/htdocs/v151719/mitmachen.adfc-velbert.de/test/wp-content/plugins/improve-my-city/functions/imc-core-taxstatus-ordering.php on line 304
    
    Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v151719/mitmachen.adfc-velbert.de/test/wp-content/plugins/improve-my-city/functions/imc-core-taxstatus-ordering.php:304) in /www/htdocs/v151719/mitmachen.adfc-velbert.de/test/wp-includes/pluggable.php on line 1216

    Suggested fix for line 304 in imc-core-taxstatus-ordering.php:

    /**
         * Add term last on insertion
         *
         * @param int $term_id
         */
        public function imcstatus_created_term( $term_id, $tt_id, $taxonomy ) {
            if ( ! $this->imcstatus_has_support( $taxonomy ) ) {
                return;
            }
    
            $terms = get_terms( 'imcstatus', array('hide_empty' => false,) );
            $terms_values = array_values($terms);
            //$lastTerm = call_user_func('end', array_values($terms) );
            $lastTerm = call_user_func_array('end', array(&$terms_values));
            $lastTermID = $lastTerm->term_id;
            $lastTermORDER = get_term_meta ( $lastTermID, 'imc_term_order');
    
            update_metadata( 'term', $term_id, 'imc_term_order', $lastTermORDER[0]+1 );
        }
Viewing 1 replies (of 1 total)
  • Plugin Author Improve My City

    (@improvemycity)

    Hello and thanks for using the Improve My City plugin.

    Good catch! This resulted in a problem when calculating the order of the new status.
    Your fix has been approved and added in the codebase. It will be live in the next plugin update.

Viewing 1 replies (of 1 total)
  • The topic ‘Error when creating a new status in backend’ is closed to new replies.