Search gives a fatal error

When searching in the search engine when logged out, it sometimes gives a fatal error, and sometimes results appear in this way in the picture, and I see a different search link.


Fatal error: Uncaught Error: Call to a member function get_images__id() on null
in /home/u735145642/domains/wmasat.com/public_html/wp-content/plugins/hivepress/includes/controllers/class-listing.php on line 664

Call stack:

  1. HivePress\Controllers\Listing::redirect_listing_view_page()
  2. call_user_func()
    wp-content/plugins/hivepress/includes/components/class-router.php:642
  3. HivePress\Components\Router::set_page_template()
    wp-includes/class-wp-hook.php:324
  4. WP_Hook::apply_filters()
    wp-includes/plugin.php:205
  5. apply_filters()
    wp-includes/template-loader.php:104
  6. require_once()
    wp-blog-header.php:19
  7. require()
    index.php:17

Hi,

Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users. If this issue exists, please provide more details (e.g., your actions step by step with screenshots, etc.). This will help us to reproduce and resolve the issue faster.

1 Like

I found the problem in plugin (youzify) which modifies the theme (buddypress) and the site works well, but I only suffer from this problem in searching. I found that the error occurs in (HivePress) specifically (class-vendor.php->242 line)(class-listing.php->664 line), as if there is a conflict in the search. Is there a way to bypass that?

class-listing.php->
public function redirect_listing_view_page() {
the_post();

	// Get listing.
	$listing = Models\Listing::query()->get_by_id( get_post() );

	// @todo replace temporary fix.
	**$listing->get_images__id();**

	// Get vendor.
	$vendor = $listing->get_vendor();

	// Set request context.
	hivepress()->request->set_context( 'listing', $listing );
	hivepress()->request->set_context( 'vendor', $vendor );

	return false;
}

class-vendor.php->
public function get_vendor_view_title() {
the_post();

	// Get vendor.
	$vendor = Models\Vendor::query()->get_by_id( get_post() );

	// Set request context.
	hivepress()->request->set_context( 'vendor', $vendor );

	**return sprintf( hivepress()->translator->get_string( 'listings_by_vendor' ), $vendor->get_name() );**
}

This (functions) is causing problems, so there is a suggestion to modify it

hallo, any answer?

You should use themes from Hivepress or try to make your WordPress theme compatible with Hivepress.

1 Like

Sorry for the delay. This issue may occur if there’s a broken or incomplete listing item, the error means that the layout tries to fetch images for a non-existing listing. Please try to unpublish listings one by one (or in bulk) and check if this issue persists, maybe one of the listings causes this.

If it’s a third-party theme conflict, unfortunately we can’t guarantee compatibility with all the third-party themes, but the search form design on the screenshot looks like TaskHive theme, if this is the case please add the license key to the forum profile settings for premium support.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.