Type Error
TypeError: Argument 1 passed to _search_api_override_apply_single_override() must be an instance of [error]
SearchApiServer, instance of SearchApiIndex given, called in
/var/www/html/sites/all/modules/contrib/search_api_override/search_api_override.module on line 139 in
_search_api_override_apply_single_override() (line 160 of
/var/www/html/sites/all/modules/contrib/search_api_override/search_api_override.module).
This is because the code standards were updated, giving the function parameter the type SearchApiServer
:
function _search_api_override_apply_single_override(SearchApiServer $component, array $override) {
But a different issue changed this to be either a server or an index. Passing a SearchApiIndex as a parameter throws the error shown.
Undefined Variable
In the same function mentioned above, the issue for overriding the "enabled" state added
if (isset($override['enabled'])) {
$server->enabled = $override['enabled'];
}
But this needs to now be the following because the param name is now $component (because server|index are both supported).
if (isset($override['enabled'])) {
$component->enabled = $override['enabled'];
}
---
A patch for the two issues is attached.
Comment | File | Size | Author |
---|---|---|---|
#3 | search_api_override-3109309-3.patch | 1.04 KB | solideogloria |
Comments
Comment #2
solideogloria CreditAttribution: solideogloria commentedComment #3
solideogloria CreditAttribution: solideogloria commentedComment #4
solideogloria CreditAttribution: solideogloria commentedComment #5
solideogloria CreditAttribution: solideogloria commentedMight as well fix some typos while we're at it...
Comment #6
ron_s CreditAttribution: ron_s commentedNoticed this as soon as I reviewed a diff of the 7.x-1.0 updates. Needs to be fixed for anyone who enables using the array, or else there will be issues.
Comment #7
ron_s CreditAttribution: ron_s commentedActually if making updates to typos, how about fixing "beeing" to "being" on line 311...
And all the typos in the
@file
at the top (lines 10 through 16)... "overriden", "inital":Comment #8
ron_s CreditAttribution: ron_s commentedKept finding more typos and just thought it best to create an updated patch. See attached.
Comment #9
solideogloria CreditAttribution: solideogloria commentedLooks good to me.
Comment #10
solideogloria CreditAttribution: solideogloria commentedCould we get this committed and released soon?
Comment #11
apadernoFixing typos in comments is out-of-scope for this issue.
Comment #12
solideogloria CreditAttribution: solideogloria commented@kiamlaluno, then use patch #3. It has no typos fixed.
Comment #13
solideogloria CreditAttribution: solideogloria commentedComment #15
vuilThe patch of #3 is already committed.
Comment #16
ron_s CreditAttribution: ron_s commentedCreated a patch covering all the spelling mistakes and typos included in #8.
Ready for review: https://www.drupal.org/project/search_api_override/issues/3135714