• Benjamin

    (@benjaminowens)


    Hello!

    The latest release of NextGEN Gallery (3.50) changed quite a bit of its internal API, and now ARI Fancy Lightbox generates a fatal exception when NextGEN Gallery 3.50 is active.

    This can be fixed with a simple change to ari-fancy-lightbox/libraries/arisoft/core/wordpress/class-nextgen.php by adding the following elseif clause inside of install_lightbox_v2():

    // NextGEN 3.50+
    } elseif ( class_exists( 'Imagely\NGG\Display\LightboxManager' ) ) {
        $ngg_lightbox_manager = \Imagely\NGG\Display\LightboxManager::get_instance();
        $lightbox_options = new \Imagely\NGG\DataTypes\Lightbox($lightbox);
        $lightbox_options->title = $lightbox_title;
        $lightbox_options->code = $code;
        $lightbox_options->styles = array();
        $lightbox_options->scripts = array();
        $ngg_lightbox_manager->register( $lightbox, $lightbox_options);

    It just needs the new Lightbox type passed instead of \stdClass.

    Have a good day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks a lot!

    Now it started to work without fatal error

    But i didnt add, i replace.

    Final variant of file ari-fancy-lightbox/libraries/arisoft/core/wordpress/class-nextgen.php

    <?php
    namespace Ari\Wordpress;
    
    class Nextgen {
        static public function is_installed_v2() {
            if ( defined( 'NEXTGEN_GALLERY_PLUGIN_VERSION' ) )
                return version_compare( NEXTGEN_GALLERY_PLUGIN_VERSION, '2.0.0', '>=' );
    
            return false;
        }
    
        static public function install_lightbox_v2( $lightbox, $lightbox_title, $code ) {
            if ( class_exists( 'C_Lightbox_Installer' ) ) {
                $installer = new \C_Lightbox_Installer();
                $is_installed = $installer->mapper->find_by_name( $lightbox );
    
                if ( ! $is_installed ) {
                    $installer->install_lightbox(
                        $lightbox,
                        $lightbox_title,
                        $code,
                        array( '', '' ),
                        array( '', '' )
                    );
                }
             // NextGEN 3.50+
    elseif ( class_exists( 'Imagely\NGG\Display\LightboxManager' ) ) {
        $ngg_lightbox_manager = \Imagely\NGG\Display\LightboxManager::get_instance();
        $lightbox_options = new \Imagely\NGG\DataTypes\Lightbox($lightbox);
        $lightbox_options->title = $lightbox_title;
        $lightbox_options->code = $code;
        $lightbox_options->styles = array();
        $lightbox_options->scripts = array();
        $ngg_lightbox_manager->register( $lightbox, $lightbox_options);  } 
            } 
        }
    }

    BUT! In Nextgen other options there is no possitibity to choose
    What lightbox would you like to use?

    There is No Choice Ari FancyBox

    other options

    Plugin Author arisoft

    (@arisoft)

    Hi

    Do you use free or PRO version of NextGEN? We tested the plugin with v. 3.55 (free edition) and it works on our test site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error with NextGEN 3.50 (solution provided)’ is closed to new replies.