Closed djzwerg closed 1 year ago
Please provide more detailed information regarding the error, including a stack trace if possible. In order to test this I need to know what conditions caused the issue. Thanks
@earlyburg which information would be helpful? I'm not able to make a stack trace. This is the only information I have for now:
My settings:
This is helpful. Can you please tell me what type of fields you are transliterating? Also, what kind of data are in the fields. I tested this and was not able to reproduce the error you are seeing. Thanks I will test this a bit more with an updated core, but I suspect it may be something specific to your environment. Can you also please give me a list of the contrib modules you are using and have enabled? Thanks.
Oh yes of course:
node
node:title
node_custom_field1 (number)
node_taxonomy_reference (text)
node_taxonomy_reference:name
node_custom_field2 (text)
node:body:value
taxonomy_term
taxonomy_term:name
https://github.com/backdrop-contrib/search_api/releases/tag/1.x-1.0.06 Please download the latest release of this module and let me know if it resolves this issue. Thanks for your patience, I appreciate it.
Hi @earlyburg and thanks for your work. I'm sorry but the issue is still there:
I've tested a bit and found out that the error always occurs even if transliteration is not enabled for any field.
I created a fresh install of backdrop latest release I installed the latest versions of search_api, search_api_solr search_api_pages. I set the filters exactly the way you have in your image and transliterated all fields Using a solr based server I was not able to reproduce this issue using content generated by the devel module.
Without access to your site and its code - I can't really go any further. I only have the github code at my disposal to evaluate, and when indexing content I am not seeing any php related messages.
Apologies, but I think this might be related to your site, and not a problem with this code per se.
`class SearchApiTransliteration extends SearchApiAbstractProcessor {
protected function process(&$value) {
// We don't touch integers, NULL values or the like.
if (is_string($value)) {
$value = transliteration_get($value, '', language_default());
}
}
}
As you can see from the class - only string data is allowed to be transliterated. It may be that what you are passing is causing the message, and not a bug in the code.` Also in our dialog you mentioned "I've tested a bit and found out that the error always occurs even if transliteration is not enabled for any field." - this indicates to me that you may be having problems that may be bigger than just a warning, as this may indicate an issue with php versions or server processing of configuration objects.
Well I don't use Search API Solr (only Search API and Search API DB). Maybe search_api_DB causes this issue? Is there a way to figure that out?
I'm using PHP 7.4.27 and MySQL 8.0.25
The problem is this line: $value = transliteration_get($value, '', language_default());
transliteration_get()
expects $langcode
to be a string, but search_api is passing it the whole object with language_default()
.
I've tested this fix and it works. LGTM and ready to be committed.
@herbdool, since your PR is from December, and you pinged @earlyburg (without a response) 3 weeks ago... should we merge this PR? If you agree, since you provided the PR, I can do it with my new "bug squad" permissions. LMK
@argiepiano yes, you can merge it.
While using the transliteration filter the following error occurs during cronjob (indexing):
Warning: Illegal offset type in isset or empty in _transliteration_replace() (line 187 of /mypath/core/includes/transliteration.inc).
Error: Object of class stdClass could not be converted to string in preg_replace() (line 188 of /mypath/core/includes/transliteration.inc).