magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

Product grid is not getting displayed, getting undefined array key "name" in logs. #35783

Open malikt opened 2 years ago

malikt commented 2 years ago

Preconditions and environment

Steps to reproduce

  1. Login as admin.
  2. Go to Store->attributes->product search code "name" and set Values Required to "NO"
  3. Create a product without name in 2.4.1 and then upgrade to 2.4.4 along with PHP.
  4. Now, create a Product without name after setting the 'Name' attribute as not mandatory.

Expected result

The Product Grid should load fine as usual.

Actual result

The Product Grid throws an alert of something went wrong and freezes.

Additional information

The Log shows the below error: main.CRITICAL: Exception: Warning: Undefined array key "name" in /vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php on line 61 in /vendor/magento/framework/App/ErrorHandler.php:61

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 years ago

Hi @malikt. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

malikt commented 2 years ago

After debugging a little bit, I have fixed the Grid issue. edit the file: /vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php and replaced the line 61 from: 'ariaLabel' => __('Edit ') . $item['name'], to 'ariaLabel' => __('Edit ') . isset($item['name'])?$item['name']:'',

m2-assistant[bot] commented 2 years ago

Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Lima commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Lima, here is your Magento Instance: https://2a9984743397f28955e3503d1b3ef2b6.instances.magento-community.engineering Admin access: https://2a9984743397f28955e3503d1b3ef2b6.instances.magento-community.engineering/admin_d133 Login: 51e40713 Password: 8787efe6e7ad

engcom-Lima commented 2 years ago

:heavy_check_mark: Issue confirmed

Issue got reproduced in 2.4-develop branch.

Description: Product grid is not displayed in the admin panel.

Pre-requisite:

  1. Install fresh M 2.4.1
  2. Upgrade to latest version.
  3. PHP 8.1

Steps to reproduce:

  1. Install 2.4.1.
  2. Login as admin.
  3. Go to Store->attributes->product search code "name" and set Values Required to "NO"
  4. Create a product without name in 2.4.1 and then upgrade to latest version of Magento along with PHP.
  5. Now, create a Product without name after setting the 'Name' attribute as not mandatory.

Expected result: Grid should be displayed. Actual result: In my case, grid is not visible and getting error in the admin panel. Screenshots: Screenshot from 2022-07-21 12-47-06

Screenshot from 2022-07-21 12-42-11

Found new issue related to this issue : https://github.com/magento/magento2/issues/35789 Hence, confirming this issue.

Thanks

Nuranto commented 2 years ago

We can confirm this issue too.

rohit-prjpt commented 2 years ago

This could happen when there is any product stored without required attribute "name" and either you can add name value or remove that bad created product.

RiccardoRoscilli commented 1 year ago

Is there a way to find with a query the product without name?

rohit-prjpt commented 1 year ago

@RiccardoRoscilli Here is the query to find out products without name

SELECT sku,entity_id FROMcatalog_product_entityWHEREentity_idNOT IN (SELECTentity_idFROMcatalog_product_entity_varcharWHEREattribute_idIN (SELECT attribute_id FROMeav_attributeWHEREattribute_code='name'))

PaperDS commented 1 year ago

SELECT sku,entity_id FROMcatalog_product_entityWHEREentity_idNOT IN (SELECTentity_idFROMcatalog_product_entity_varcharWHEREattribute_idIN (SELECT attribute_id FROMeav_attributeWHEREattribute_code='name'))

This worked great for me. Found 6 products and then ran an import on those products to add a name/Product Name and that sorted the issue.

vandijkstef commented 1 year ago

Reconfirming issue on 2.4.4 - Not sure why it has been able to save product entities without a name (title) set (on the base store view) but it happened. This is fully breaking the admin grid functionality, even in production, due to attempted rendering of an aria label. (So high impact for a 'minor' feature).

Fix as per comment https://github.com/magento/magento2/issues/35783#issuecomment-1189348535 is solid. Not sure why this low hanging fruit with high impact is on the low prio backlog. Will slam in a PR in a minute

jonathanribas commented 1 year ago

Hi, confirming this issue on 2.4.5 too, we have this issue very often on production too.

hgati commented 1 year ago

@RiccardoRoscilli다음은 이름이 없는 제품을 찾는 쿼리입니다.

SELECT sku,entity_id FROMcatalog_product_entity WHEREentity_id NOT IN (SELECTentity_id FROMcatalog_product_entity_varchar WHEREattribute_id IN (SELECT attribute_id FROMeav_attribute WHEREattribute_code='name'))

I was using Magento 2.4.6 + PHP 8.2 on production environment and had a cron job running every midnight to scrape and automatically update product information. However, this morning when I checked the admin page, the product grid was not showing up. and fortunately, I found the cause.

The product with SKU value "K00001" was originally an existing product. However, seeing that a new SKU "K00001-1" was created, it seems that during the scraping of product information, there was a duplication of the URL key, causing Magento to mistakenly create an empty product.

Not only the "name" attribute, but other attributes used in the product were also empty. Therefore, I simply deleted the product using the "delete from ~" query, and the grid displayed correctly on the admin page.

It's been a few months, and it happened again, so I came back here after searching on Google. In my case, this error occasionally occurs when I scrap the product, perform automatic translation, and upload the content.

SELECT entity_id, sku FROM catalog_product_entity A WHERE NOT EXISTS (
    SELECT 'x' 
    FROM catalog_product_entity_varchar B, eav_attribute C
    WHERE A.entity_id=B.entity_id AND B.attribute_id=C.attribute_id AND C.attribute_code='name'
) 
entity_id  sku     
---------  --------
    24436  K08187  
<?php
require '/var/www/magento/app/bootstrap.php';
$bootstrap = Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objectManager->get('Magento\Framework\App\State')->setAreaCode(Magento\Framework\App\Area::AREA_ADMINHTML);
$objectManager->get('\Magento\Store\Model\StoreManagerInterface')->setCurrentStore(0);
$objectManager->get('Magento\Framework\Registry')->register('isSecureArea', true);

$productCollection = $objectManager->create(\Magento\Catalog\Model\ResourceModel\Product\Collection::class);
$productCollection->addAttributeToSelect('*')->addFieldToFilter('entity_id', ['eq' => 24436])
    ->addAttributeToSort('entity_id', 'ASC');
foreach($productCollection as $prod) {
    print_r($prod->getData());
}
Array
(
    [entity_id] => 24436
    [attribute_set_id] => 11
    [type_id] => simple
    [sku] => K08187
    [has_options] => 0
    [required_options] => 0
    [created_at] => 2023-08-09 22:11:09
    [updated_at] => 2023-08-09 22:11:09
    [meta_title] => Experience this oneElegance with 
    [meta_description] => Immerse this on
    [image] => /-/f/-fu-0.jpg
    [small_image] => /-/f/-fu-0.jpg
    [thumbnail] => /-/f/-fu-0.jpg
    [options_container] => container2
    [image_label] =>  #0
    [small_image_label] =>  #0
    [thumbnail_label] =>  #0
    [url_key] => fu
    [msrp_display_actual_price_type] => 0
    [sourcing_product_id] => 2970736
    [cost_price] => 0
    [news_from_date] => 2023-08-09 00:00:00
    [news_to_date] => 2023-08-23 00:00:00
    [status] => 0
    [visibility] => 4
    [quantity_and_stock_status] => 1
    [tax_class_id] => 0
    [pre_order] => 0
    [limited_edition] => 0
    [ox_featured] => 0
    [ox_gallery_video_index] => 2
    [ox_gallery_video_listing_hover] => 0
    [ox_gallery_video_stop_on_click] => 1
    [ox_gallery_video_autoplay] => 1
    [ox_gallery_video_loop] => 1
    [ox_gallery_video_controls] => 0
    [ox_custom] => 0
    [goods_type] => 8688
    [price] => 0.000000
    [weight] => 0.000000
    [language_edition] => 6101
    [store_id] => 0
)
/* Delete the record (catalog_product_entity T/B) with entity_id */
DELETE FROM catalog_product_entity WHERE entity_id=24436
alitopaloglu commented 1 year ago

I ran the query above, returns no products without a name but I can still reproduce this issue on v2.4.6

rohit-prjpt commented 1 year ago

@alitopaloglu You have the exact error with attribute name? if you have error with different key instead of name then you might have different require attributes missing values, make sure and query for the attribute which you see on the error

alitopaloglu commented 1 year ago

I'm pretty sure it's the name attribute because the error message says

Warning: Undefined array key "name" in vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php on line 61

rohit-prjpt commented 1 year ago

@alitopaloglu You might have caching issue or try to print the product object to debug on the same file vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php on line 61 so you'll see which product is causing issues

vandijkstef commented 1 year ago

There is a PR up to solve this on the rendering layer, but I have no clue how to move forward from here.

asim-blueprintprep commented 1 year ago

This error has also occurred for us when using the native product import - the default amount of errors is set to 10 for some reason, so you can import products with no name.

MIANZAHOOR commented 11 months ago

This error occurs when you have imported any product without a name. You have to remove the error by replacing the following code in the path file.

/vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php

        `      if (isset($dataSource['data']['items'])) {
                     $storeId = $this->context->getFilterParam('store_id');

                    foreach ($dataSource['data']['items'] as &$item) {
                        if (isset($item['name'])) {
                            $item[$this->getData('name')]['edit'] = [
                                'href' => $this->urlBuilder->getUrl(
                                    'catalog/product/edit',
                                    ['id' => $item['entity_id'], 'store' => $storeId]
                                ),
                                'ariaLabel' => __('Edit ') . $item['name'],
                                'label' => __('Edit'),
                                'hidden' => false,
                            ];
                        } else {
                            $item[$this->getData('name')]['edit'] = [
                                'href' => $this->urlBuilder->getUrl(
                                    'catalog/product/edit',
                                    ['id' => $item['entity_id'], 'store' => $storeId]
                                ),
                                'label' => __('Edit'),
                                'hidden' => false,
                            ];
                        }
                    }
                }

`

MilenV commented 10 months ago

Hello @MIANZAHOOR, @hgati @malikt and Team,

We observe similar issue on Production where we are on Adobe Commerce ver. 2.4.5-p2 Actual Exception being thrown refers to Undefined array key "visibility" Exception: Warning: Undefined array key "visibility" in /app/vka64lyl5tm4m/vendor/amasty/pgrid/Plugin/Catalog/Ui/DataProvider/Product/ProductDataProvider.php on line 286

Please could you advise us how this can be troubleshooted and resolved potentially?

Regards, Milen Velinov

rohit-prjpt commented 10 months ago

Hello @MIANZAHOOR, @hgati @malikt and Team,

We observe similar issue on Production where we are on Adobe Commerce ver. 2.4.5-p2 Actual Exception being thrown refers to Undefined array key "visibility" Exception: Warning: Undefined array key "visibility" in /app/vka64lyl5tm4m/vendor/amasty/pgrid/Plugin/Catalog/Ui/DataProvider/Product/ProductDataProvider.php on line 286

Please could you advise us how this can be troubleshooted and resolved potentially?

Regards, Milen Velinov

You must have NULL values stored for attribute "visibility", so use the following query to find out those products

SELECT sku,entity_id FROM catalog_product_entity WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity_int WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code='visibility'))

MIANZAHOOR commented 10 months ago

Hi @rohit-prjpt, Go to ProductDataProvider.php file and edit the code on line 286. Here, you have to add check if array key "visibility" is set then execute the code.

rohit-prjpt commented 10 months ago

Yes, that is patch in code, instead fix the value in database to fix it with current code,

Hi @rohit-prjpt, Go to ProductDataProvider.php file and edit the code on line 286. Here, you have to add check if array key "visibility" is set then execute the code.

MilenV commented 10 months ago

Hello @rohit-prjpt @MIANZAHOOR @hgati

We executed suggested query below in the database on Production, but unfortunately returned results were EMPTY. SELECT sku,entity_id FROM catalog_product_entity WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity_int WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code='visibility')) Do you have any other suggestions you might be able to provide us with?

Can you please give us an idea what we should do with below line of code 286?

Go to ProductDataProvider.php file and edit the code on line 286. Here, you have to add check if array key "visibility" is set then execute the code.

Regards, Milen Velinov

rohit-prjpt commented 10 months ago

Hello @rohit-prjpt @MIANZAHOOR @hgati

We executed suggested query below in the database on Production, but unfortunately returned results were EMPTY. SELECT sku,entity_id FROM catalog_product_entity WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity_int WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code='visibility')) Do you have any other suggestions you might be able to provide us with?

Can you please give us an idea what we should do with below line of code 286?

Go to ProductDataProvider.php file and edit the code on line 286. Here, you have to add check if array key "visibility" is set then execute the code.

Regards, Milen Velinov

@MilenV In that case more detailed debug required, can't guess what is going on without debugging.

MilenV commented 10 months ago

Hello @rohit-prjpt

I am providing you with the whole error we caught.

`Exception: Warning: Undefined array key "visibility" in /app/vka64lyl5tm4m/vendor/amasty/pgrid/Plugin/Catalog/Ui/DataProvider/Product/ProductDataProvider.php on line 286 in /app/vka64lyl5tm4m/vendor/magento/framework/App/ErrorHandler.php:62 Stack trace:

0 /app/vka64lyl5tm4m/vendor/amasty/pgrid/Plugin/Catalog/Ui/DataProvider/Product/ProductDataProvider.php(286): Magento\Framework\App\ErrorHandler->handler()

1 /app/vka64lyl5tm4m/vendor/amasty/pgrid/Plugin/Catalog/Ui/DataProvider/Product/ProductDataProvider.php(427): Amasty\Pgrid\Plugin\Catalog\Ui\DataProvider\Product\ProductDataProvider->_initExtra()

2 /app/vka64lyl5tm4m/vendor/amasty/pgrid/Plugin/Catalog/Ui/DataProvider/Product/ProductDataProvider.php(389): Amasty\Pgrid\Plugin\Catalog\Ui\DataProvider\Product\ProductDataProvider->processExtraColumn()

3 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(146): Amasty\Pgrid\Plugin\Catalog\Ui\DataProvider\Product\ProductDataProvider->afterGetData()

4 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider\Interceptor->Magento\Framework\Interception{closure}()

5 /app/vka64lyl5tm4m/generated/code/Magento/Catalog/Ui/DataProvider/Product/ProductDataProvider/Interceptor.php(23): Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider\Interceptor->___callPlugins()

6 /app/vka64lyl5tm4m/vendor/magento/module-ui/Component/Listing.php(38): Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider\Interceptor->getData()

7 /app/vka64lyl5tm4m/vendor/magento/framework/View/Element/UiComponent/Context.php(250): Magento\Ui\Component\Listing->getDataSourceData()

8 /app/vka64lyl5tm4m/vendor/magento/framework/View/Layout/Generic.php(75): Magento\Framework\View\Element\UiComponent\Context->getDataSourceData()

9 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout\Generic->build()

10 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Generic\Interceptor->___callParent()

11 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Generic\Interceptor->Magento\Framework\Interception{closure}()

12 /app/vka64lyl5tm4m/generated/code/Magento/Framework/View/Layout/Generic/Interceptor.php(23): Magento\Framework\View\Layout\Generic\Interceptor->___callPlugins()

13 /app/vka64lyl5tm4m/vendor/magento/framework/View/Layout/Generator/Structure.php(46): Magento\Framework\View\Layout\Generic\Interceptor->build()

14 /app/vka64lyl5tm4m/vendor/magento/module-ui/TemplateEngine/Xhtml/Result.php(102): Magento\Framework\View\Layout\Generator\Structure->generate()

15 /app/vka64lyl5tm4m/vendor/magento/module-ui/TemplateEngine/Xhtml/Result.php(124): Magento\Ui\TemplateEngine\Xhtml\Result->appendLayoutConfiguration()

16 /app/vka64lyl5tm4m/vendor/magento/module-ui/Controller/Adminhtml/Index/Render.php(91): Magento\Ui\TemplateEngine\Xhtml\Result->__toString()

17 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Ui\Controller\Adminhtml\Index\Render->execute()

18 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->___callParent()

19 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->Magento\Framework\Interception{closure}()

20 /app/vka64lyl5tm4m/generated/code/Magento/Ui/Controller/Adminhtml/Index/Render/Interceptor.php(23): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->___callPlugins()

21 /app/vka64lyl5tm4m/vendor/magento/framework/App/Action/Action.php(111): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->execute()

22 /app/vka64lyl5tm4m/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()

23 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()

24 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->___callParent()

25 /app/vka64lyl5tm4m/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->Magento\Framework\Interception{closure}()

26 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()

27 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->Magento\Framework\Interception{closure}()

28 /app/vka64lyl5tm4m/generated/code/Magento/Ui/Controller/Adminhtml/Index/Render/Interceptor.php(32): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->___callPlugins()

29 /app/vka64lyl5tm4m/vendor/magento/framework/App/FrontController.php(245): Magento\Ui\Controller\Adminhtml\Index\Render\Interceptor->dispatch()

30 /app/vka64lyl5tm4m/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()

31 /app/vka64lyl5tm4m/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()

32 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()

33 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()

34 /app/vka64lyl5tm4m/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()

35 /app/vka64lyl5tm4m/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()

36 /app/vka64lyl5tm4m/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()

37 /app/vka64lyl5tm4m/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()

38 /app/vka64lyl5tm4m/pub/index.php(30): Magento\Framework\App\Bootstrap->run()

39 {main}`

I hope this is helpful enough for troubleshooting and narrow down where the issue comes from and how to fix it.

Regards, Milen Velinov

rohit-prjpt commented 10 months ago

@MilenV looking at error log, seems to be error from amasty plugin, try to disable plugin amasty/pgrid and check.

MIANZAHOOR commented 10 months ago

Hello @MilenV It's a bug of amasty plugin so you have to edit the code in the file ProductDataProvider.php. Can you share code from 280 line to 295 line?

rohit-prjpt commented 10 months ago

Hello @MilenV It's a bug of amasty plugin so you have to edit the code in the file ProductDataProvider.php. Can you share code from 280 line to 295 line?

@MilenV Please find the below line if ((int)$row['visibility'] !== Visibility::VISIBILITY_NOT_VISIBLE) {

And change it to the following: if (isset($row['visibility']) && (int)$row['visibility'] !== Visibility::VISIBILITY_NOT_VISIBLE) {

Let me know if that works or not!

MilenV commented 10 months ago

Hello @rohit-prjpt

Below is the part of the code between lines 274 and 298:

274 protected function _initExtra(array &$row, string $column): void 275 { 276 if (isset($row['store_id']) && $row['store_id'] !== 0) { 277 $store = $this->storeManager->getStore($row['store_id']); 278 } else { 279 $store = $this->storeManager->getWebsite($row['website_ids'][0] ?? null)->getDefaultStore(); 280 } 281 282 switch ($column) { 283 case 'amasty_link': 284 $row[$column] = ''; 285 286 if ((int)$row['visibility'] !== Visibility::VISIBILITY_NOT_VISIBLE) { 287 if (!empty($row['request_path'])) { 288 $row[$column] = $store->getUrl('', ['_direct' => $row['request_path']]); 289 } else { 290 $row[$column] = $store->getUrl( 291 null, 292 ['_direct' => 'catalog/product/view/id/' . $row['entity_id']] 293 ); 294 } 295 break; 296 } 297 } 298 }

Regards, Milen Velinov

rohit-prjpt commented 10 months ago

Hello @MilenV It's a bug of amasty plugin so you have to edit the code in the file ProductDataProvider.php. Can you share code from 280 line to 295 line?

@MilenV Please find the below line if ((int)$row['visibility'] !== Visibility::VISIBILITY_NOT_VISIBLE) {

And change it to the following: if (isset($row['visibility']) && (int)$row['visibility'] !== Visibility::VISIBILITY_NOT_VISIBLE) {

Let me know if that works or not!

change your line 286 as per my reply above

MIANZAHOOR commented 10 months ago

@MilenV

You have to add an additional check in which it will check the "visibility" index is set(available) or not because in you condition it doesn't found "visibility" index for $row array. so you can do it by replacing 286 line by following line of code.

if (isset($row['visibility']) && (int)$row['visibility'] !== Visibility::VISIBILITY_NOT_VISIBLE) {

@rohit-prjpt you are right.

mattb-ascend commented 10 months ago

This error has also occurred for us when using the native product import - the default amount of errors is set to 10 for some reason, so you can import products with no name.

I can reproduce using the import AND including the name field. If I specify store_view_code for a newly added product, it seems that the "default" view is what the admin grid uses.

rohit-prjpt commented 10 months ago

This error has also occurred for us when using the native product import - the default amount of errors is set to 10 for some reason, so you can import products with no name.

I can reproduce using the import AND including the name field. If I specify store_view_code for a newly added product, it seems that the "default" view is what the admin grid uses.

When you import with store_view_code then it must set all values under defined store_view only but when you load the grid page by default it must have ADMIN Default Values but if you have store view filters in place then it must take values from specific store view,

For this specific issue, you only need to query to fix NULL value in your database, nothing else

vakokakokit commented 8 months ago

For Enterprise version . Query to get product with no name.

SELECT sku, entity_id FROM catalog_product_entity WHERE row_id NOT IN ( SELECT row_id FROM catalog_product_entity_varchar WHERE attribute_id IN ( SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 4 ))

motomaxinc commented 7 months ago

Hi, I am new to magento and I got the same issue. I have made a website on cloudways auto installation so I am unable to find these steps. But I did find it through another directory and set product searchable vale for name to NO but the issue is still not fixed. Can someone help? Thank you.

Steps to reproduce

  1. Login as admin. - OK
  2. Go to Store->attributes->product search code "name" and set Values Required to "NO"
  3. Create a product without name in 2.4.1 and then upgrade to 2.4.4 along with PHP.
  4. Now, create a Product without name after setting the 'Name' attribute as not mandatory.
RiccardoRoscilli commented 7 months ago

Hello, run the query and delete all the products with no name. There's no way they can fix it

motomaxinc commented 7 months ago

Thank you. I did not know how to run a query so I edited the product name in csv file, re-imported the file and it fixed the issue.

Hello, run the query and delete all the products with no name. There's no way they can fix it

engcom-Delta commented 2 weeks ago

Hi @malikt ,

Thanks for your reporting and collaboration. We have verified the issue in latest 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.

Steps to reproduce

  1. Login as admin.
  2. Go to Store->attributes->product search code "name" and set Values Required to "NO" image
  3. Import product with no name.
  4. Access Catalog>Products
  5. Observe Error displays when product is imported with no name image

Thanks.

github-jira-sync-bot commented 2 weeks ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13014 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 weeks ago

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.