• Добрый день, с недавнего времени перестала работать галерея NextGen при включения плагина Advanced Custom Fields: NextGEN Gallery Field add-on, на странице редактирования контента вылазит ошибка

    Fatal error: Uncaught Error: Call to undefined method nggdb::find_all_galleries() in /var/www/u2599254/data/www/sunrayhotel.ru/wp-content/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg-v5.php:187 Stack trace: #0 /var/www/u2599254/data/www/sunrayhotel.ru/wp-content/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg-v5.php(257): acf_field_ngg->ngg_get_galleries() #1 /var/www/u2599254/data/www/sunrayhotel.ru/wp-includes/class-wp-hook.php(324): acf_field_ngg->render_field(Array) #2 /var/www/u2599254/data/www/sunrayhotel.ru/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(», Array) #3 /var/www/u2599254/data/www/sunrayhotel.ru/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #4 /var/www/u2599254/data/www/sunrayhotel.ru/wp-content/plugins/advanced-custom-fields/includes/acf-hook-functions.php(113): do_action_ref_array(‘acf/render_fiel…’, Array) #5 /var/www/u2599254/data/www/sunrayhotel.ru/wp-includes/class-wp-hook.php(324): _acf_apply_hook_variations(Array) #6 /var/www/u25 in /var/www/u2599254/data/www/sunrayhotel.ru/wp-content/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg-v5.php on line 187

    <?php

    class acf_field_ngg extends acf_field {


    /*
    * __construct
    *
    * This function will setup the field type data
    *
    * @type function
    * @date 23/11/2014
    * @since 2.1
    *
    * @param n/a
    * @return n/a
    */

    function __construct() {

    // vars
    $this->name = 'ngg';
    $this->label = __('NextGEN Gallery', 'acf-ngg');
    $this->category = 'relational';

    $this->defaults = array(
    'input_type' => 'select',
    'allow_null' => 1,
    //'input_size' => 5,
    'multiple' => 'select',
    'multiple_size' => 5,
    'nextgen_type' => 'Galleries and Albums',
    'ui' => 0,
    'ajax' => 0,
    'placeholder' => '',
    'disabled' => 0,
    'readonly' => 0,
    );

    // ajax
    //add_action('wp_ajax_acf/fields/select/query', array($this, 'ajax_query'));
    //add_action('wp_ajax_nopriv_acf/fields/select/query', array($this, 'ajax_query'));

    // action
    add_action( 'admin_enqueue_scripts', array($this, 'admin_enqueue_scripts') );

    // do not delete!
    parent::__construct();

    }


    /*
    * query_posts
    *
    * description
    *
    * @type function
    * @date 22/10/14
    * @since 2.1
    *
    * @param n/a
    * @return n/a
    */

    /*

    function ajax_query() {


    }

    */

    /*
    * render_field_settings()
    *
    * Create extra settings for your field. These are visible when editing a field
    *
    * @type action
    * @since 2.1
    * @date 23/11/14
    *
    * @param $field (array) the $field being edited
    * @return n/a
    */

    function render_field_settings( $field ) {

    acf_render_field_setting( $field, array(
    'label' => __('Allow Null?', 'acf'),
    'instructions' => '',
    'type' => 'radio',
    'name' => 'allow_null',
    'layout' => 'horizontal',
    'choices' => array(
    '1' => __( 'Yes' ),
    '0' => __( 'No' )
    )
    ));

    acf_render_field_setting( $field, array(
    'label' => __('Nextgen Type'),
    'instructions' => 'Allow or restrict the Nextgen selection type.',
    'type' => 'select',
    'name' => 'nextgen_type',
    'layout' => 'horizontal',
    'choices' => array(
    'Galleries and Albums' => __( 'Galleries and Albums' ),
    'Galleries' => __( 'Galleries' ),
    'Albums' => __( 'Albums' )
    )
    ));

    // multiple
    acf_render_field_setting( $field, array(
    'label' => __('Select multiple values?', 'acf'),
    'instructions' => '',
    'type' => 'select',
    //'name' => 'input_type',
    'name' => 'multiple',
    'class' => 'acf-ngg-input-method',
    'layout' => 'horizontal',
    'choices' => array(
    'select' => __( 'Select' ),
    'multiselect' => __( 'Multi-Select' )
    )
    ));

    //if ($field['multiple'] == 'multiple') :

    // multiple_size
    acf_render_field_setting( $field, array(
    'label' => __('Multi-Select Size'),
    'instructions' => 'The number of rows to show at once in a multi-select.',
    'type' => 'select',
    //'name' => 'input_size',
    'name' => 'multiple_size',
    'class' => ($field['multiple'] == 'select') ? 'ngg-select' : 'ngg-select',
    'layout' => 'horizontal',
    'choices' => array_combine( range( 3, 15, 2 ), range( 3, 15, 2 ) )
    ));

    //endif;

    // ui
    /*acf_render_field_setting( $field, array(
    'label' => __('Stylised UI', 'acf'),
    'instructions' => '',
    'type' => 'radio',
    'name' => 'ui',
    'choices' => array(
    1 => __("Yes",'acf'),
    0 => __("No",'acf'),
    ),
    'layout' => 'horizontal',
    ));*/


    }

    /*
    * ngg_get_galleries()
    *
    * Get all the NextGen/NextCellent Galleries
    *
    * @type function
    * @since 2.1
    * @date 23/11/14
    *
    * @param n/a
    * @return array of galleries
    */

    function ngg_get_galleries() {

    if ( class_exists('nggdb') ) {

    // Settings of NextGEN Gallery SQL query
    $limit = 0;
    $start = 0;
    $order_by = 'title';
    $order_dir = 'ASC';
    $galleries = false;

    // Seek to all NextGEN Galleries
    $gallerylist = nggdb::find_all_galleries( $order_by, $order_dir, true, $limit, $start, false);
    return array( $gallerylist );

    }

    }

    выше часть кода плагина до 187 строки

    на самой станице с галерей пишет — [Not a valid template]

    Подскажите а каком направлении копать, Спасибо.

Просмотр 1 ответа (всего 1)
  • delllirium, привет. Аддон не обновлялся более 10 лет, так что если и «копать», то в сторону его отключения/удаления и последующей замены.

Просмотр 1 ответа (всего 1)