Okay
  Public Ticket #991720
activating advanced custom fields leads to fatal error
Closed

Comments

  •  2
    jjhb started the conversation

    When I try to activate the advanced custom fields plugin, I get the following error message:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare get_field() (previously declared in /srv/www/jjhb/htdocs/wp-content/themes/kalium/inc/laborator_functions.php:179) in /srv/www/jjhb/htdocs/wp-content/plugins/advanced-custom-fields/core/api.php on line 204

  • [deleted] replied

    Hi jjhb,

    Can you please share your WP credentials here, because I need to login to your site and test this issue. Your information is safe here (private) in this thread.

    To include your credentials click Insert Credentials button in editor toolbar. (See how)

  •  2
    jjhb replied

    Sorry I don't think that's possible, since I'm running a local Vagrant dev installation, it's this: https://github.com/Varying-Vagrant-Vagrants/VVV

    Perhaps you can check that, or if you have any other info you need let me know. I've seen many comments on theme forest with the exact same error, not likely to be isolated to my installation. 

  • [deleted] replied

    Hi there,

    One of the users have wrote this

    I just installed the theme on my local machine / localhost.

    I solved the problem by commenting out 

    if ( false == function_exists( 'get_field' ) && false == kalium()->helpers->isPluginActive( 'advanced-custom-fields/acf.php' ) ) {
    function get_field( $field_id, $post_id = null ) {
    global $post;

    if ( is_numeric( $post_id ) ) {
    $post = get_post( $post_id );
    }

    return $post->{$field_id};
    }
    }

    in inc folder laborator_functions.php

    After that it was possible to activiate Advanced Custom Fields.

    After Activation of the plugin I removed the comments in laborator_functions.php and it seems to work...

    Can you please try this?

    Meanwhile we will check where is this problem coming from and try to resolve it.

  •  2
    jjhb replied

    Thanks that seems to work for now! Will it be fixed in an update?

  • [deleted] replied

    Hi jjhb,

    We have fixed this problem, but it is still happening to some users, we think that the problem is happening because some users are using old versions of PHP on their servers.

    We will closely investigate this problem and if there is a fix we will release a new update for sure.

    Will set this ticket as solved from here.

    Have a nice weekend

  •  2
    jjhb replied

    This is the version I'm using:

    PHP Version 7.0.14-2+deb.sury.org~trusty+1

  • [deleted] replied

    Hi jjhb,

    Thanks for your cooperation