Here is a patch to fix this error when indexing node body:
PHP Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in search_api/includes/processor.inc on line 295
I had this error with tokens for body fields like this:
$tokens = array('value' => '...', 'safe_value' => '...', 'format' => '...')
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | non_array_token-7.x-1.20-2085717-11853777.patch | 593 bytes | denix |
| non_array_token.patch | 593 bytes | cthiebault |
Comments
Comment #1
drunken monkeyThanks for reporting this! However, the bug seems to be in an entirely different area: it seems Search API is somehow trying to index the whole
bodyfield, instead of just the value, which shouldn't be possible.Are you using the latest version of Search API? On the index's "Fields" tab, what is the machine name of the indexed body field (or all body fields that have "Indexed" checked)?
Does this happen for all items, or just for some/one? Could you find out the value of
$databefore$this->preprocessIndexItems($data);in the index class (ca. line 499 ofincludes/index_entity.inc), or at least the relevant sub-key(s) of it?Comment #2
azin commentedCan this be committed? I encountered the same issue with latest, 7.x-1.15 Search API and the patch solved it for me.
Comment #3
drunken monkeyNo, as said in #1, it cannot. It's entirely the wrong place to fix this.
Please answer my questions in #1 to help resolve this.
Also, please explain your basic setup, especially the processors you're using.
Comment #4
denix commentedHi, Thanks for the module.
I confirm that this patch solve the problem for me too, using search_api 7.12.
I started having this problem when I activated wysiwyg on one of the indexed fields. I hope this can lead to a proper solution.
Comment #5
denix commentedComment #6
denix commentedRegenerated the patch for version 7.x-1.20.
Comment #7
drunken monkeyThat still leaves my other questions unanswered – and also, "search_api 7.12" is no module version. Do you mean "7.x-1.12"? Or 1.20, for which you've created the patch? (Which seems to have been unnecessary in any case, by the way.)
Comment #8
drunken monkeyComment #9
denix commentedHi @drunken monkey, sorry for the mistake. it is search_api 7.x-1.20 (now, at the time of comment #4 was 7.x-1.12). The issue is the same, you activate HTML for the field and search_api give you the fatal error because of the data structure. It is easy to reproduce.
Comment #10
drunken monkeyOK, good to know.
However, I still need answers to my questions in #1 for helping you.
Also, what are the steps to reproduce? Just index the body field and then switch on WYSIWYG for it? Steps from a clean install would be best.
Comment #11
denix commentedexactly what you you just said:
the result is the error reported here and the patch solve it.
Comment #12
zalak.addweb commentedComment #13
drunken monkeyCouldn't reproduce this.
Using the default node index (which of course has the body indexed) I …
As per #1, it would be helpful to know the value of
$databefore processing.Comment #14
legolasboI am closing this issue because information was requested over a year ago, but no new information has been provided since. Please reopen this issue with the requested information if you think that this issue is still relevant.