Jump to content

Topic on Extension talk:Elastica

PHP 7.2+ requires upgrade to ruflin/elastica 5.3.2 to avoid deprecated call to each()

4
Chiefgeek157 (talkcontribs)

As of the release fo Elastica for MediaWiki 1.31.1, composer.json requires ruflin/elastica 5.3.0. However, that release uses a deprecated call to each(), which PHP 7.2+ catches. ruflin/elastica 5.3.2 has been released which replaces the deprecated call with other logic.

I have locally edited the composer.json file for this extension to update to elastica-5.3.2, and the problem goes away. i recommend all releases of Extension:Elastica which are supported on versions of MediaWiki which support PHP 7.2+ be updated to use ruflin/elastica-5.3.2 or better in composer.json.

Hcpag (talkcontribs)

Hi, When i using ruflin/elastica 5.3.0 return this error:


Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Multi/MultiBuilder.php on line 50

Call Stack

# Time Memory Function Location

1 0.0002 399928 {main}( ) .../index.php:0

2 0.0837 3865912 MediaWiki->run( ) .../index.php:42

3 0.3998 6809384 MediaWiki->doPostOutputShutdown( ) .../MediaWiki.php:557

4 0.3998 6812368 MediaWiki->{closure:/var/www/html/includes/MediaWiki.php:725-732}( ) .../MediaWiki.php:750

5 0.3998 6812368 MediaWiki->restInPeace( ) .../MediaWiki.php:727

6 0.4017 6815648 MediaWiki->triggerJobs( ) .../MediaWiki.php:912

7 0.4019 6817736 MediaWiki->triggerSyncJobs( ) .../MediaWiki.php:988

8 0.4020 6819544 JobRunner->run( ) .../MediaWiki.php:1002

9 0.4136 6926440 JobRunner->executeJob( ) .../JobRunner.php:193

10 0.4138 6926728 CirrusSearch\Job\LinksUpdate->run( ) .../JobRunner.php:296

11 0.4138 6926776 CirrusSearch\Job\LinksUpdate->doJob( ) .../Job.php:99

12 0.4139 6930856 CirrusSearch\Updater->updateFromTitle( ) .../LinksUpdate.php:52

13 0.4228 7108040 CirrusSearch\Updater->updatePages( ) .../Updater.php:83

14 0.4232 7116608 CirrusSearch\Updater->buildDocumentsForPages( ) .../Updater.php:205

15 1.0124 9260872 Hooks::run( ) .../Updater.php:424

16 1.0125 9260872 Hooks::callHook( ) .../Hooks.php:205

17 1.0125 9261648 CirrusSearch\BuildDocument\RedirectsAndIncomingLinks::finishBatch( ) .../Hooks.php:177

18 1.0125 9261760 CirrusSearch\BuildDocument\RedirectsAndIncomingLinks->realFinishBatch( ) .../RedirectsAndIncomingLinks.php:93

19 1.0126 9266168 Elastica\Multi\Search->search( ) .../RedirectsAndIncomingLinks.php:157

20 1.0241 9282720 Elastica\Multi\MultiBuilder->buildMultiResultSet( ) .../Search.php:152

21 1.0241 9282720 Elastica\Multi\MultiBuilder->buildResultSets( ) .../MultiBuilder.php:17

22 1.0241 9283120 each ( ) .../MultiBuilder.php:50


I update to 5.3.2, now search dont return results, nothing.

Using:

MediaWiki 1.31.1

PHP 7.2.10-0ubuntu0.18.04.1 (apache2handler)

MariaDB 10.1.34-MariaDB-0ubuntu0.18.04.1

ICU 60.2

Elasticsearch 5.6.3

Lua 5.1.5

Elasticsearch is running ok, extensions Elastica 1.3.0.0 (9fcf88c) 08:09 11 oct 2018 and CirrusSearch 0.2 (4330942) 21:17 16 oct 2018

curl -s localhost:9200

{

  "name" : "HHS_8mf",

  "cluster_name" : "docker-cluster",

  "cluster_uuid" : "phiq1MvXRPaSSK5O46vnkQ",

  "version" : {

    "number" : "5.6.3",

    "build_hash" : "1a2f265",

    "build_date" : "2017-10-06T20:33:39.012Z",

    "build_snapshot" : false,

    "lucene_version" : "6.6.1"

  },

  "tagline" : "You Know, for Search"

}


Spiros71 (talkcontribs)

I have the same "deprecated call "error, does updating ruflin/elastica to 5.3.2 require reindexing? How exactly is that done?

Reply to "PHP 7.2+ requires upgrade to ruflin/elastica 5.3.2 to avoid deprecated call to each()"