Hi Kseniia,
Thank you for looking into this. We’ve found the root cause.
The issue is a conflict between the built-in Listing Packages module and the Memberships extension. Both register the listing_feature_complete_page route with their own action and redirect callbacks. When HivePress merges them via merge_arrays, it concatenates the arrays instead of one overriding the other, resulting in a 4-element array like this:
[action] => Array
(
[0] => HivePress\Controllers\Membership Object
[1] => render_listing_feature_complete_page
[2] => HivePress\Controllers\Listing_Package Object
[3] => render_listing_feature_complete_page
)
call_user_func() on line 674 of class-router.php expects exactly 2 members ([$object, 'method']), so it throws a fatal error.
This explains why you couldn’t reproduce it - you likely tested with Memberships only, without the Listing Packages module active. On our setup both are present.
We’ve applied a temporary workaround - a filter on hivepress/v1/routes (priority 1000) that trims the arrays back to 2 elements, keeping only the Memberships callbacks:
php
add_filter('hivepress/v1/routes', function($routes) {
if (isset($routes['listing_feature_complete_page']['action']) && is_array($routes['listing_feature_complete_page']['action']) && count($routes['listing_feature_complete_page']['action']) > 2) {
$routes['listing_feature_complete_page']['action'] = [
$routes['listing_feature_complete_page']['action'][0],
$routes['listing_feature_complete_page']['action'][1],
];
}
if (isset($routes['listing_feature_complete_page']['redirect']) && is_array($routes['listing_feature_complete_page']['redirect']) && count($routes['listing_feature_complete_page']['redirect']) > 2) {
$routes['listing_feature_complete_page']['redirect'] = [
$routes['listing_feature_complete_page']['redirect'][0],
$routes['listing_feature_complete_page']['redirect'][1],
];
}
return $routes;
}, 1000);
This works, but it’s not ideal as a permanent solution. Could this be addressed in a future update so the Memberships extension properly overrides the Packages route callbacks?
Update - second issue discovered:
After fixing the fatal error, we tested the featuring flow end-to-end. When a vendor features a listing through the Memberships plan (Featuring Limit: 1, Featuring Period: 30), hp_featured is set to 1 successfully. However:
-
Featuring Date and Expiration Date remain empty in the listing edit screen
-
No hp_featured_time or expiry-related meta is saved in post meta
-
No Action Scheduler task is created for the featuring expiry
This means the listing stays featured permanently and never auto-expires, even though the membership plan has a Featuring Period of 30 days configured.
Tested on staging with HivePress 1.7.23 and Memberships 2.2.0.
Update 2 - resolved the fatal error, found new issue with featuring limit:
We resolved the fatal error by deactivating the Paid Listings extension. It turns out Paid Listings was overriding the Memberships featuring logic and also causing the route conflict (the 4-element array issue we described earlier). With Paid Listings deactivated, the route fix snippet is no longer needed and Memberships correctly blocks featuring for vendors without a plan - they get redirected to the plans page as expected.
However, we discovered a new issue: the Featuring Limit is not enforced.
Steps to reproduce:
-
Create a membership plan with Featuring Limit: 1 and Featuring Period: 30
-
Purchase the plan as a non-admin vendor
-
The membership is created correctly with Featuring Limit showing as 1
-
Feature one listing - works, limit decreases to 0
-
Attempt to feature a second listing - it succeeds and the listing becomes featured, even though the limit is 0
Expected behavior: the second featuring attempt should be blocked since the limit has been reached.
Tested on HivePress 1.7.23 and Memberships 2.2.0 with Paid Listings deactivated.
Could this be looked into as well?
Thanks! Ivan