elasticsuite icon indicating copy to clipboard operation
elasticsuite copied to clipboard

Categories with Manually Sorted Products not loading after upgrade to 2.11.9

Open gaiterjones opened this issue 1 year ago • 3 comments

After upgrading from 2.11.4.2 to 2.11.9 all categories with manual sorting enabled will not load in backend see errors below.

If I try to downgrade to 2.11.4.2 I cannot open any categories due to an exception error

Magento Version : 2.4.6p3

ElasticSuite Version : 7.16.1

Environment : Production

Steps to reproduce

  1. upgrade from 2.11.4.2 to 2.11.9
  2. open any category in backend admin with manual sorting enabled

Expected result

  1. In backend admin clicking on a categories with manual sorted products should open without error

Actual result

Cannot open any category in backend admin with manually sorted products as shown in screenshot Weihnachtsmarkt and sub categories: es_Untitled-1

Logged error in 2.11.9 when clicking on category with manual sorted products in backend

[2024-10-11T13:35:39.710691+00:00] main.CRITICAL: TypeError: Smile\ElasticsuiteVirtualCategory\Model\Preview::getSortBy(): Return value must be of type string, null returned in /var/www/dev/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-virtual-category/Model/Preview.php:224

Exception report when downgrading to 2.11.4.2 and clicking any category in backend

{"0":"Class \"Smile\\ElasticsuiteCatalog\\Model\\Category\\Attribute\\Source\\SortDirection\" does not exist","1":"#1 Magento\\Framework\\Code\\Reader\\ClassReader->getConstructor() called at [vendor\/magento\/framework\/ObjectManager\/Definition\/Runtime.php:54]\n#2 Magento\\Framework\\ObjectManager\\Definition\\Runtime->getParameters() called at [vendor\/magento\/framework\/ObjectManager\/Factory\/Compiled.php:100]\n#3 Magento\\Framework\\ObjectManager\\Factory\\Compiled->create() called at [vendor\/magento\/framework\/ObjectManager\/ObjectManager.php:56]\n#4 Magento\\Framework\\ObjectManager\\ObjectManager->create() called at [vendor\/magento\/framework\/Validator\/UniversalFactory.php:36]\n#5 Magento\\Framework\\Validator\\UniversalFactory->create() called at [vendor\/magento\/module-eav\/Model\/Entity\/Attribute\/AbstractAttribute.php:642]\n#6 Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute->getSource() called at [generated\/code\/Magento\/Catalog\/Model\/ResourceModel\/Eav\/Attribute\/Interceptor.php:824]\n#7 Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute\\Interceptor->getSource() called at [vendor\/magento\/module-catalog\/Model\/Category\/DataProvider.php:427]\n#8 Magento\\Catalog\\Model\\Category\\DataProvider->getAttributesMeta() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#9 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#10 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#11 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->___callPlugins() called at [generated\/code\/Smartwave\/Megamenu\/Model\/Category\/DataProvider\/Interceptor.php:50]\n#12 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->getAttributesMeta() called at [vendor\/magento\/module-catalog\/Model\/Category\/DataProvider.php:335]\n#13 Magento\\Catalog\\Model\\Category\\DataProvider->prepareMeta() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#14 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#15 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#16 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->___callPlugins() called at [generated\/code\/Smartwave\/Megamenu\/Model\/Category\/DataProvider\/Interceptor.php:32]\n#17 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->prepareMeta() called at [vendor\/magento\/module-catalog\/Model\/Category\/DataProvider.php:267]\n#18 Magento\\Catalog\\Model\\Category\\DataProvider->getMeta() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#19 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#20 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/smile\/elasticsuite\/src\/module-elasticsuite-catalog\/Plugin\/Ui\/Category\/Form\/DataProviderPlugin.php:95]\n#21 Smile\\ElasticsuiteCatalog\\Plugin\\Ui\\Category\\Form\\DataProviderPlugin->aroundGetMeta() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#22 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#23 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->___callPlugins() called at [generated\/code\/Smartwave\/Megamenu\/Model\/Category\/DataProvider\/Interceptor.php:23]\n#24 Smartwave\\Megamenu\\Model\\Category\\DataProvider\\Interceptor->getMeta() called at [vendor\/magento\/framework\/View\/Element\/UiComponentFactory.php:330]\n#25 Magento\\Framework\\View\\Element\\UiComponentFactory->mergeMetadata() called at [vendor\/magento\/framework\/View\/Element\/UiComponentFactory.php:231]\n#26 Magento\\Framework\\View\\Element\\UiComponentFactory->create() called at [vendor\/magento\/framework\/View\/Layout\/Generator\/UiComponent.php:140]\n#27 Magento\\Framework\\View\\Layout\\Generator\\UiComponent->generateComponent() called at [vendor\/magento\/framework\/View\/Layout\/Generator\/UiComponent.php:103]\n#28 Magento\\Framework\\View\\Layout\\Generator\\UiComponent->process() called at [vendor\/magento\/framework\/View\/Layout\/GeneratorPool.php:93]\n#29 Magento\\Framework\\View\\Layout\\GeneratorPool->process() called at [vendor\/magento\/framework\/View\/Layout.php:365]\n#30 Magento\\Framework\\View\\Layout->generateElements() called at [generated\/code\/Magento\/Framework\/View\/Layout\/Interceptor.php:32]\n#31 Magento\\Framework\\View\\Layout\\Interceptor->generateElements() called at [vendor\/magento\/framework\/View\/Layout\/Builder.php:129]\n#32 Magento\\Framework\\View\\Layout\\Builder->generateLayoutBlocks() called at [vendor\/magento\/framework\/View\/Page\/Builder.php:65]\n#33 Magento\\Framework\\View\\Page\\Builder->generateLayoutBlocks() called at [vendor\/magento\/framework\/View\/Layout\/Builder.php:65]\n#34 Magento\\Framework\\View\\Layout\\Builder->build() called at [vendor\/magento\/framework\/View\/Layout.php:271]\n#35 Magento\\Framework\\View\\Layout->build() called at [vendor\/magento\/framework\/View\/Layout.php:896]\n#36 Magento\\Framework\\View\\Layout->getBlock() called at [vendor\/magento\/module-backend\/Model\/View\/Result\/Page.php:26]\n#37 Magento\\Backend\\Model\\View\\Result\\Page->setActiveMenu() called at [vendor\/magento\/module-catalog\/Controller\/Adminhtml\/Category\/Edit.php:113]\n#38 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit->execute() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#39 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#40 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#41 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Catalog\/Controller\/Adminhtml\/Category\/Edit\/Interceptor.php:23]\n#42 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->execute() called at [vendor\/magento\/framework\/App\/Action\/Action.php:111]\n#43 Magento\\Framework\\App\\Action\\Action->dispatch() called at [vendor\/magento\/module-backend\/App\/AbstractAction.php:151]\n#44 Magento\\Backend\\App\\AbstractAction->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#45 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#46 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-backend\/App\/Action\/Plugin\/Authentication.php:145]\n#47 Magento\\Backend\\App\\Action\\Plugin\\Authentication->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#48 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#49 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Catalog\/Controller\/Adminhtml\/Category\/Edit\/Interceptor.php:32]\n#50 Magento\\Catalog\\Controller\\Adminhtml\\Category\\Edit\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/FrontController.php:245]\n#51 Magento\\Framework\\App\\FrontController->getActionResponse() called at [vendor\/magento\/framework\/App\/FrontController.php:212]\n#52 Magento\\Framework\\App\\FrontController->processRequest() called at [vendor\/magento\/framework\/App\/FrontController.php:147]\n#53 Magento\\Framework\\App\\FrontController->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#54 Magento\\Framework\\App\\FrontController\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#55 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#56 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php:23]\n#57 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/Http.php:116]\n#58 Magento\\Framework\\App\\Http->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:264]\n#59 Magento\\Framework\\App\\Bootstrap->run() called at [pub\/index.php:30]\n","url":"\/vwe_dev_2k20_1\/catalog\/category\/index\/key\/cc7e48329d142bdd5f44d8268caa2351653e774378b599bae3a612e4ccf2576f\/","script_name":"\/index.php","report_id":"5e332749c9480e797b3aa3efcd3eb81aa344a021107274735874fbe8e6957179"}

gaiterjones avatar Oct 11 '24 13:10 gaiterjones

Update - downgrade issue was resolved by https://github.com/Smile-SA/elasticsuite/issues/3390 backend categories are working again. Downgraded the module and will wait for further updates before using the new version.

This problem with latest version still exists:

Logged error in 2.11.9 when clicking on category with manual (virtual category?) sorted products in backend

[2024-10-11T13:35:39.710691+00:00] main.CRITICAL: TypeError: Smile\ElasticsuiteVirtualCategory\Model\Preview::getSortBy(): Return value must be of type string, null returned in /var/www/dev/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-virtual-category/Model/Preview.php:224

/**
 * Get sort by attribute.
 *
 * @return string
 */
private function getSortBy() : string
{
    if (!$this->sortBy) {
        $useConfig = $this->request->getParam('use_config', []);
        $useConfig = array_key_exists('default_sort_by', $useConfig) && $useConfig['default_sort_by'] == 'true';
        $defaultSortBy = $this->categoryConfig->getProductListDefaultSortBy();
        $this->sortBy = $useConfig ? $defaultSortBy : $this->request->getParam('default_sort_by');
    }

    return $this->sortBy;
}

gaiterjones avatar Oct 12 '24 08:10 gaiterjones

@gaiterjones can you add more details especially about PHP version and Magento deploy mode ? (I guess it's production).

Regards

romainruaud avatar Oct 16 '24 13:10 romainruaud

@romainruaud tested with PHP8.1, PHP8.3 and Magento 2.4.6, 2.4.7 in developer and production modes.

gaiterjones avatar Oct 17 '24 13:10 gaiterjones

Update

I have tested all releases from 2.11.5 to 2.11.9 and they all display the same error where I cannot load any categories with manually sorted products. Also the version that does work 2.11.4 will not compile in Magento 2.4.7-p3

Compilation was started.
Repositories code generation... 1/9 [===>------------------------]  11% 1 sec 96.0 MiBPHP Fatal error:  Declaration of Smile\ElasticsuiteCore\Model\ResourceModel\Search\Request\RelevanceConfig::_construct() must be compatible with Magento\Config\Model\ResourceModel\Config::_construct(?Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface $pillPut = null) in /var/www/dev/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig.php on line 98

Fatal error: Declaration of Smile\ElasticsuiteCore\Model\ResourceModel\Search\Request\RelevanceConfig::_construct() must be compatible with Magento\Config\Model\ResourceModel\Config::_construct(?Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface $pillPut = null) in /var/www/dev/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig.php on line 98

gaiterjones avatar Oct 21 '24 15:10 gaiterjones

@gaiterjones can you check if this PR fixes your issue ? https://github.com/Smile-SA/elasticsuite/pull/3419

By the way, how much products having a position are you having in this category ? I guess you're having a lot of them.

Regards

romainruaud avatar Oct 22 '24 09:10 romainruaud

@romainruaud after upgrading to 2.11.9.1 the categories load now but the manual sort option is not available see images below:

2.11.9.1 es-new-version

2.11.4.2 es-old-version

Notice in 2,11,9,1 the listing sort by and sort direction drop downs are not populated.

There are not more than 20 or 30 products in the manually sorted category.

gaiterjones avatar Oct 22 '24 13:10 gaiterjones

@gaiterjones the manual sort is only displayed when sorting by "Position" now. So most likely it's not shown because your current sort order is " ".

What do you have in the dropdown of the "Default Product Listing Sort By" ?

Regards

romainruaud avatar Oct 22 '24 14:10 romainruaud

@romainruaud as I said both dropdowns Default Product Listing Sort By and Sort Direction are empty.

If I try to force position as the only available listing sortby I get the error "Default Product Listing Sort by does not exist in Available Product Listing Sort By".

es-sort-by

NOTE - in 2.11.4.2 the dropdown is populated:

es-sort-by2

gaiterjones avatar Oct 22 '24 14:10 gaiterjones

Do you have any javascript error in the console ?

The dropdown for Sort Direction is a source model with just ASC and DESC, very surprising that this dropdown appears empty.

Regards

romainruaud avatar Oct 22 '24 15:10 romainruaud

@romainruaud in 2.11.4.2 the dropdown is populated.

No JS errors seen in the console.

Default Product Listing Sort By and Sort Direction dropdown boxes are empty in ALL categories

gaiterjones avatar Oct 23 '24 08:10 gaiterjones

@gaiterjones, it looks like it's quite a specific issue because we can't reproduce it and figure out how Default Product Listing Sort By and Sort Direction dropdown boxes could be empty in ALL categories.

Most likely, the cause of your problem is somewhere in the database. I'm not sure if the problem is on the Elasticsuite side in this case, of course I could be wrong.

Could you try to test your issue on a fresh Magento with the latest version of the Elasticsuite to make sure that everything works as it should, and then try to import a database dump of your store to check if the problem is somewhere in the database.

BR, Vadym

vahonc avatar Oct 28 '24 15:10 vahonc

@vahonc all I can say is that I have been using elasticsuite in production for five years without any issues and the update since 2.11.5 has now broken some functionality. I will do some more testing as you have suggested.

gaiterjones avatar Oct 28 '24 16:10 gaiterjones

HI @gaiterjones what's the current state of this issue now that the dust has settled ?

romainruaud avatar Feb 13 '25 14:02 romainruaud

@romainruaud unfortunately the issue still exists with all versions after 2.11.4.2. As @vahonc suggested the problem may lie in the database but I have no idea how to resolve it.

gaiterjones avatar Feb 18 '25 10:02 gaiterjones

@gaiterjones,

Could you try to test your issue on a fresh Magento with the latest version of the Elasticsuite to make sure that everything works as it should, and then try to import a database dump of your store to check if the problem is somewhere in the database.

Have you tried to reproduce your issue in this way?

BR, Vadym

vahonc avatar Feb 18 '25 10:02 vahonc

@vahonc - thankyou for taking the time to respond, here is a summary of the issue again:

In version 2.11.4.2 everything works as expected.

It is clear from the commits that in 2.11.4.3 in categories the default product listing sortby dropdown in admin has been overridden, and there is a new elasticsuite sort direction dropdown

Image

Image

Image

The new dropdowns are empty which means I cannot select a sortby option and 'position' is required for manual sorting of products in the category, therefore manual sorting is broken. I can prove this by setting the default sortby for the frontend to 'position' in the database

Image

Now the category is manually sortable again but dropdowns are still empty. This is no use to me as I do not want position to be the default sortby value.

The database shows that categories where I use manual sorting do have a position sortby value saved but this value is obviously not being found by your module.

Image

Logs show the following error

[2025-02-18T11:28:48.512205+00:00] main.CRITICAL: Exception message: Default Product Listing Sort by does not exist in Available Product Listing Sort By. Trace: <pre>#1 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:59] #2 Magento\Framework\ObjectManager\ObjectManager->create() called at [vendor/magento/framework/Validator/UniversalFactory.php:36] #3 Magento\Framework\Validator\UniversalFactory->create() called at [vendor/magento/module-eav/Model/Entity/AbstractEntity.php:707] #4 Magento\Eav\Model\Entity\AbstractEntity->walkAttributes() called at [generated/code/Magento/Catalog/Model/ResourceModel/Category/Interceptor.php:428] #5 Magento\Catalog\Model\ResourceModel\Category\Interceptor->walkAttributes() called at [vendor/magento/module-eav/Model/Entity/AbstractEntity.php:890] #6 Magento\Eav\Model\Entity\AbstractEntity->validate() called at [generated/code/Magento/Catalog/Model/ResourceModel/Category/Interceptor.php:518] #7 Magento\Catalog\Model\ResourceModel\Category\Interceptor->validate() called at [vendor/magento/module-catalog/Model/Category.php:1098] #8 Magento\Catalog\Model\Category->validate() called at [generated/code/Magento/Catalog/Model/Category/Interceptor.php:401] #9 Magento\Catalog\Model\Category\Interceptor->validate() called at [vendor/magento/module-catalog/Controller/Adminhtml/Category/Save.php:214] #10 Magento\Catalog\Controller\Adminhtml\Category\Save->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58] #11 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #12 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #13 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Adminhtml/Category/Save/Interceptor.php:23] #14 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111] #15 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151] #16 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #17 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #18 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145] #19 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #20 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #21 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Adminhtml/Category/Save/Interceptor.php:50] #22 Magento\Catalog\Controller\Adminhtml\Category\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245] #23 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212] #24 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:146] #25 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #26 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #27 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #28 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23] #29 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116] #30 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #31 Magento\Framework\App\Http\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #32 Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php:38] #33 Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #34 Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #35 Magento\Framework\App\Http\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23] #36 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264] #37 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]

My current solution to this problem is to stay on version 2.11.4.2. I had hoped that someone else would experience this issue and an update would resolve it. I realise that at some point I will no longer be able to use 2.11.4.2 with the latest version of Magento which will of course become a major issue for me.

I do not have a lot of third party modules installed, the only customisation to do with sorting that I have is that I use created_at as the default frontend sort option to sort products by their creation date.

Whilst not a solution perhaps the module should include some kind of logic to catch this situation.

gaiterjones avatar Feb 18 '25 13:02 gaiterjones

@romainruaud after upgrading to 2.11.9.1 the categories load now but the manual sort option is not available see images below:

2.11.9.1 es-new-version

2.11.4.2 es-old-version

Notice in 2,11,9,1 the listing sort by and sort direction drop downs are not populated.

There are not more than 20 or 30 products in the manually sorted category.

I had the same "Not populated fields" error, found out it was related to the Megamenu of my theme (Porto). Check if any of your modules is overwriting the DataProvider protected function getFieldsMap(). Mine was returning an array missing the fields from Elastic Suite. I just commented the whole function, now it works.

mdesplenter avatar Mar 26 '25 12:03 mdesplenter

@mdesplenter you are a life saver - this is exactly the problem and it is caused by megamenu extending \Magento\Catalog\Model\Category\DataProvider in the porto theme :

    protected function getFieldsMap()
    {
        return [
            'general' =>
                [
                    'parent',
                    'path',
                    'is_active',
                    'include_in_menu',
                    'name',
                ],
            'content' =>
                [
                    'image',
                    'description',
                    'landing_page',
                ],
            'display_settings' =>
                [
                    'display_mode',
                    'is_anchor',
                    'available_sort_by',
                    'use_config.available_sort_by',
                    'default_sort_by',
                    'use_config.default_sort_by',
                    'filter_price_range',
                    'use_config.filter_price_range',
                ],
            'search_engine_optimization' =>
                [
                    'url_key',
                    'url_key_create_redirect',
                    'use_default.url_key',
                    'url_key_group',
                    'meta_title',
                    'meta_keywords',
                    'meta_description',
                ],
            'assign_products' =>
                [
                ],
            'design' =>
                [
                    'custom_use_parent_settings',
                    'custom_apply_to_products',
                    'custom_design',
                    'page_layout',
                    'custom_layout_update',
                ],
            'schedule_design_update' =>
                [
                    'custom_design_from',
                    'custom_design_to',
                ],
            'sw-menu' =>
                [
                    'sw_menu_hide_item',
                    'sw_menu_type',
                    'sw_menu_static_width',
                    'sw_menu_cat_columns',
                    'sw_menu_float_type',
                    'sw_menu_cat_label',
                    'sw_menu_icon_img',
                    'sw_menu_font_icon',
                    'sw_menu_block_top_content',
                    'sw_menu_block_left_width',
                    'sw_menu_block_left_content',
                    'sw_menu_block_right_width',
                    'sw_menu_block_right_content',
                    'sw_menu_block_bottom_content',
                ],
            'category_view_optimization' =>
                [
                ],
            'category_permissions' =>
                [
                ],
        ];
    }

Will removing the function remove some functionality from the menu?

gaiterjones avatar Mar 26 '25 12:03 gaiterjones

very interesting !

but it also looks like a crappy implementation on the Porto side, no ?

I mean, they could inherit the existing values at some point, or just add what they need with a plugin, instead of overwriting stuff ...

romainruaud avatar Mar 26 '25 15:03 romainruaud

Related: https://github.com/magento/magento2/issues/30586 Seems it was an issue to add fields to the category form in older versions of Magento, and devs did just overwrite that function without caring about other modules. Indeed very crappy, but I guess it was needed.

Another thread here: https://github.com/Smile-SA/elasticsuite/issues/3309 The last comments made me dive into the Megamenu module, would be nice if we can put this post also on that thread.

@gaiterjones In my project I only use the frontend part of the module, it only shows a couple of static blocks with content. But I can still update and change the category fields in the backend, just don't know if it changes anything. Just give it a try.

mdesplenter avatar Mar 26 '25 16:03 mdesplenter

I think the best option is to comment out the di preference

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!--<preference for="Magento\Catalog\Model\Category\DataProvider" type="Smartwave\Megamenu\Model\Category\DataProvider" />-->
</config>

Thanks again for all assistance given, I would never have thought a frontend menu module would be the cause of a backend admin problem - I guess eventually I might have found it but It would have taken me a long time!

gaiterjones avatar Mar 27 '25 09:03 gaiterjones

thanks guy for helping each others, very heartwarming. We couldn't have been able to help because we don't know and don't have access to this megamenu module. And on top of that, it's unlikely we would have had suspected it.

Keep it going and once again, thanks for helping out there !

romainruaud avatar Mar 27 '25 09:03 romainruaud