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

app/code/Smile/ElasticsuiteSwatches/view/frontend/layout/catalogsearch_result_index.xml double-defines and throws Critical Developer Error #170

Closed
southerncomputer opened this issue Oct 17, 2016 · 20 comments
Assignees

Comments

@southerncomputer
Copy link
Contributor

With magento 2.1.2

app/code/Smile/ElasticsuiteSwatches/view/frontend/layout/catalogsearch_result_index.xml

Redefines this block class and throws a Critical error in developer-mode.

`

    <referenceBlock name="category.product.type.details.renderers">
        <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml" />
    </referenceBlock>
</body>

`

In my case to overcome this error I had to change as="configurable" to as="configurable2" to rid the render error.

I am not sure if this is a correct way to fix this problem, but I do not use Swatches (yet!).

@afoucret
Copy link
Contributor

Hi @southerncomputer,

Can you please forward us the exact error log message / exception and the version of ElasticSuite you are using ?

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 17, 2016

[2016-10-17 15:54:23] report.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_48f8f27b8478aea82e0ee080b652907b7 and handles default, catalogsearch_result_index: Please correct the XML data and try again.  [] []

@southerncomputer
Copy link
Contributor Author

Also when viewing by categories - it appears to 500 error out with no log in developer/production mode. I will try to log the request to elasticsearch and update. This is on latest push/magento 2.1.2 EE after a fresh database re-install.

@afoucret
Copy link
Contributor

@southerncomputer,

You are right with this one. The bug occured only with Magento 2.1.2 since Magento have merged recently a PR by @romainruaud from our team (magento/magento2#3638).

A temporary fix was present into our code and can now be removed to avoid the ducplicate block. @romainruaud : can you please remove your code from the layout please ?

BR,

@afoucret
Copy link
Contributor

Target versions : next 2.2.x and 2.3.x

@romainruaud
Copy link
Collaborator

Woops... I did not expect my first contribution to Magento will break our own module :)

I fix this one ASAP.

@romainruaud
Copy link
Collaborator

PR #171 will fix the layout issue.

About the fatal error, I do not notice a such bug in our environment, can you give us details @southerncomputer ? Maybe the error can be found on the Apache logs.

Regards,

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 18, 2016

...

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 19, 2016

Also nginx error log:

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 20, 2016

2016/10/20
I back ported to elasticsuite 2.2 and still get this error which makes no sense!

@romainruaud
Copy link
Collaborator

Magento\Catalog\Model\ResourceModel\Product\Collection

It looks like your instance does not use the ElasticSuite product collection.

Did you clean properly everything that's involved into di ? Did you recompile and clear opcode cache ?

I do not reproduce this issue on a Magento 2.1.2 EE at all, so this may be related to your environment.

Regards,

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 20, 2016

Is it sane to define this plugin (but is it really a plugin?) with the same name as in the extended Layer Plugin in their di.xml?
`type name="Magento\Catalog\Model\Layer">
plugin name="addStockStatusOnPrepareFrontCollection" type="Magento\CatalogInventory\Model\Plugin\Layer"/>

type name="Magento\Catalog\Model\Layer">
plugin name="addStockStatusOnPrepareFrontCollection" type="Smile\ElasticsuiteCatalog\Plugin\LayerPlugin"/>
`


` Would this cause confusion?

@afoucret
Copy link
Contributor

It is not a confusion since the purpose of this code was to replace the Magento implementation of this plugin.

I will check these exceptions tomorrow and if something have changed in Magento 2.1.2.

BR,

@southerncomputer
Copy link
Contributor Author

Well This is a tricky one since it is a plugin that extends another plugin class. I didn't think that was even possible!

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 20, 2016

Okay I cleaned that up with a fresh reinstall using composer but am still getting this odd behavior on any search -->

I have re-indexed everything - on magento 2.1.2 EE with elastic search 2.2.2 composer install'd.

@afoucret
Copy link
Contributor

Hi @southerncomputer,

First insight this morning after I quickly installed a clean Magento 2.1.2 version and ElasticSuite (2.3.x) : the engine seems to be reseted to MySQL during the install. I could be the cause of your problems.

Can you check your configuration into Store > Configuration > Catalog > Catalog Search and report me what engine is configured there ?

As I did not drop my database before installing, I will investigate on how this could happen and what happen with a clean DB.

If it is the case a workaround is to change this settings manually.

@southerncomputer
Copy link
Contributor Author

Yes - I checked this it appears to still be getting stuck on addSortFilterParameters - what php version are you using? I'm on 7.0.12

@southerncomputer
Copy link
Contributor Author

southerncomputer commented Oct 21, 2016

here is debug from a search to elasticsearch:

@southerncomputer
Copy link
Contributor Author

Could you try deploying with php 7.0.12 and tell me if you get the error at Layerplugin.php when clicking on a category only?

@romainruaud
Copy link
Collaborator

Hello @southerncomputer

Happy to see you closing this one. How did you resolve it ?

regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants