Skip to content
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: adminSortIndex #677

Closed
jeroenkosse opened this issue Jan 3, 2018 · 5 comments
Closed

Undefined index: adminSortIndex #677

jeroenkosse opened this issue Jan 3, 2018 · 5 comments
Assignees
Labels

Comments

@jeroenkosse
Copy link

Exception #0 (Exception): Notice: Undefined index: adminSortIndex in /vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php on line 271

Preconditions

Magento Version : 2.2.1

ElasticSuite Version : 2.4.6

Steps to reproduce

When there is a space after the label for a specific attribute the module is trying to find the value with the space. The label from the item from the variable $items that is passed to the array is not containing the space.

Possible solution

$optionLabel = trim((string)$option['label']);

@romainruaud
Copy link
Collaborator

Hello @jeroenkosse and thank you for using our module.

I just reproduced your bug on my testing environment, so it's confirmed.

Will try to provide a fix for this one.

@romainruaud romainruaud self-assigned this Jan 3, 2018
@romainruaud romainruaud added the bug label Jan 3, 2018
@afoucret
Copy link
Contributor

afoucret commented Jan 3, 2018

Agree with triming like proposed by @jeroenkosse

@romainruaud
Copy link
Collaborator

Yes this is due to the fact that we trim the option label when indexing, so when re-sorting them in the attribute model, we have in entry the trimmed option label, and we try to sort on the "raw" one which is not trimmed.

I tested this solution and proposed PR #678

@jeroenkosse
Copy link
Author

Thnx for the quick response and hope to fetch a new release soon

@afoucret
Copy link
Contributor

afoucret commented Jan 3, 2018

PR merged.

@afoucret afoucret closed this as completed Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants