-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Updating from control panel occasionally yields error ”Call to a member function update() on null“ #121
Comments
I’ll also add that if an entry will not save to the index with that error, I can save it as a new entry in Craft and the new entry will push to the index without a problem! I’m also happy to provide our affected db if you need to troubleshoot at any point. |
So what's happening is here: https://github.com/riasvdv/craft-scout/blob/master/src/jobs/MakeSearchable.php#L34
public function execute($queue)
{
if (!$element = $this->getElement()) {
return;
}
$engine = $element->searchableUsing()->first(function (Engine $engine) {
return $engine->scoutIndex->indexName === $this->indexName;
});
// Handle $engine coming back as null as per: https://github.com/riasvdv/craft-scout/issues/121 -- aaw/2020.01.02
if (!$engine) {
return;
}
$engine->update($element);
if ($this->propagate) {
$element->searchableRelations();
}
} I can do a PR if you're still around @riasvdv -- probably just as easy for you to apply the fix tho, if you're up for it. |
I'm so sorry, completely lost track of this issue, I've added this fix in 2.1.4 |
Removes the undefined function error found at studioespresso/craft-scout#121
I’m running the latest version of Scout (2.1.2) and Craft (3.3.15). If I submit my indices from the command line, they all process as normal and things seem to work just fine.
However, I find that some of my entries will fail when the authors attempt to update their entry in the control panel with the following stacktrace in
queue.log
:In this example, I have disabled literally every field, facet, etc., in the index setup as shown here and flushed all the old settings
dev_news
which this should post to:I'm a bit stymied about how to proceed. I can alleviate the problem when it arises by updating the indices from the command line, and things work as normal, but that incurs a HUGE overhead of operations as the process touches literally every other section's index on the site.
Is there anything I might be missing here that needs to be set or declared?
The text was updated successfully, but these errors were encountered: