Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while starting the indexer: [] operator not supported for strings (PHP 7.1) #86

Closed
derandy opened this issue Mar 15, 2017 · 3 comments
Milestone

Comments

@derandy
Copy link

derandy commented Mar 15, 2017

Starting the indexer in the Backend throws an Error which is related to PHP 7.1 afaik
Neither the BackendModule nor the scheduler is working.

[] operator not supported for strings

Error thrown in file
/../../typo3conf/ext/ke_search/Classes/hooks/class.user_kesearchhooks.php in line 41.
@steffenk
Copy link

this can be fixed easy:

tx_kesearch_indexer, line 40:
change var $additionalFields = ''; into var $additionalFields = [];

@a-r-m-i-n
Copy link
Contributor

I am not able to reconstruct this issue. Tested with PHP 7.1.5 (7.1.5-1+deb.sury.org~xenial+1).

Also the \user_kesearch_sortdate::registerAdditionalFields method expects an array as parameter (which is referenced). So instead of overwriting the array always with an empty one, we should ensure that just arrays are passed to the method. We could also type hint the expected array, to make this method more strict.

As far as I can see in tx_kesearch_indexer, the default value for $this->additionalFields is already an array. So the only reason I can imagine why you got this issue, is that another registred hook destroys the array...

@christianbltr
Copy link
Collaborator

In class.tx_kesearch_indexer.php in Line 38 $additionalFields is already defined as $array.
It has been fixed in
4d7439a
So I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants