-
Notifications
You must be signed in to change notification settings - Fork 347
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
Undefined index: name in Autocomplete/Category/ItemFactory.php #1855
Comments
Hello @PivitParkour94 Regards |
That's the issue. Not too sure what's causing it, but somehow the document source is being loaded with the name field missing. We've just noticed the log creeping up with these errors, it most likely is bad data in the database, but verifying an array key is set before using it is a good way to avoid these issues. We have patched it locally and it would be good to not have to maintain our own patched version, if we're getting this error once, someone somewhere else will also get this error. Just wanting to help make the module more stable. Would you prefer I make a PR and you can accept/reject it as you see fit? I'd rather not put in the effort if it will just be rejected. Cheers |
Hello @PivitParkour94 Regards |
Yes, we should check the array key before using it, for sure. Most probably, we should not return anything from the ItemFactory if name is missing : we would not have anything to display into the autocomplete box. Most probably, the origin of the bug can be :
@PivitParkour94 you can submit a PR if you want. regards |
…y-autocomplete Fix #1855 undefined category name
Preconditions
PHP 7.3
Magento Version : 2.3.5-p1 (Open Source)
ElasticSuite Version : N/A
Environment : Production
Third party modules :
Steps to reproduce
Found that the following error is being thrown
[DATE] main.CRITICAL: Notice: Undefined index: name in /vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php on line 100
Expected result
Should check for the name key in the array before using it.
Actual result
Sometimes the name is missing and throws an error.
The error being thrown doesn't seem to effect the functionality, just can become an issue when extra logs are being thrown that aren't needed.
The text was updated successfully, but these errors were encountered: