• Resolved dansart

    (@dansart)


    Hi

    I just noticed that my website got fatal errors after updating to to 3.5.4
    After some digging I found that the class nggdb was changed completely and also the method, I use in my plugin, got removed.
    The method is search_for_galleries(). Why did it got removed? What would be the correct way to search for galleries by keyword with the new update?

    Best, Daniel

Viewing 2 replies - 1 through 2 (of 2 total)
  • Benjamin

    (@benjaminowens)

    Hello @dansart!

    The search_for_galleries() method was removed because it was no longer used by NextGEN itself, and the 3.50 release was focused on removing legacy aspects that were no longer needed or necessary – my apologies for the inconvenience.

    You can search the available galleries by keyword using your own search; how exactly depends on how you were using that method. I would recommend starting with something like this:

    global $wpdb;
    
    $search_term  = 'something';
    
    // Trim quotes and whitespace
    $search_term = trim( $search_term, "\"'\n\r" );
    
    $result  = $wpdb->get_results(
    	$wpdb->prepare(
    		"SELECT * FROM {$wpdb->nggallery} WHERE title LIKE %s OR galdesc LIKE %s ORDER BY title ASC",
    		[
    			'%' . $wpdb->esc_like( $search_term ) . '%',
    			'%' . $wpdb->esc_like( $search_term ) . '%',
    		]
    	)
    );
    
    Thread Starter dansart

    (@dansart)

    Hi
    Thanks a lot for the answer. I managed to make it work again.
    Best, Daniel

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Update 3.5.X crashes because of missing nggdb methods’ is closed to new replies.