WP Search with Algolia and wpsolr fatal error

  • 2for5whoppers
    Participant
    1 year, 5 months ago #31406

    I am trying to update to wpsolr 22.3 and wp search with algolia 2.3.0, but am getting a fatal error ….

    PHP message: PHP Fatal error: Cannot redeclare Algolia\AlgoliaSearch\Http\Psr7\stream_for() (previously declared in /www/foo/public/wp-content/plugins/wp-search-with-algolia/includes/libraries/algoliasearch-client-php/src/Http/Psr7/functions.php:10) in /www/foo/public/wp-content/plugins/wpsolr-pro/wpsolr/core/vendor/algolia/algoliasearch-client-php/src/Http/Psr7/functions.php on line 10

    wpsolr
    Keymaster
    1 year, 5 months ago #31408

    Both plugins use the same Algolia’s php client library, but probably not with the same version. Hence the error.

    2for5whoppers
    Participant
    1 year, 5 months ago #31417

    is there any way for me to resolve this?

    2for5whoppers
    Participant
    1 year, 5 months ago #31418

    Looking at both plugins I found this in wpsolr-pro …

    namespace Algolia\AlgoliaSearch;
    
    use Algolia\AlgoliaSearch\Cache\NullCacheDriver;
    use Algolia\AlgoliaSearch\Http\HttpClientInterface;
    use Algolia\AlgoliaSearch\Log\DebugLogger;
    use Psr\Log\LoggerInterface;
    use Psr\SimpleCache\CacheInterface;
    
    final class Algolia
    {
        const VERSION = '3.3.0';
    

    The wpsearch with algolia plugin uses const VERSION = '3.3.2';
    How can I resolve this conflict?

    wpsolr
    Keymaster
    1 year, 5 months ago #31419

    I do not think you can.

    You’ll have to choose one plugin over the other.

    2for5whoppers
    Participant
    1 year, 5 months ago #31420

    solution was to just go into wp-search-with-algolia and comment out 2 different declarations in 2 different functions.php files.

    wpsolr
    Keymaster
    1 year, 5 months ago #31421

    Great.

    But what do you try to achieve with 2 Algolia search plugins?

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.