olegkoval / magento2-regenerate_url_rewrites

Magento 2 extension which add feature of regenerating a url rewrites of products/categories
Academic Free License v3.0
428 stars 118 forks source link

Exception Undefined index: dirname #123

Closed Mairon001 closed 4 years ago

Mairon001 commented 4 years ago

Hi All, i have download and installed the module with manual installation. After have execute setup:upgrade / compile etc... after all have digit php bin/magento ok:urlrewrites:regenerate

and it return to me this error

[Type: product, Store ID: 1, Store View code: en]: [=============================================> ] 65% 11/17

[Exception] Notice: Undefined index: dirname in /home/folder_name/public_html/folder_name_2/app/code/OlegKoval/RegenerateUrlRewrites/Model/AbstractRegenerateRewrites.php on line 320

the reason ?

olegkoval commented 4 years ago

Hello @Mairon001

In this file extension check a generated Url Rewrites and split them into parts by using "pathinfo()" (built-in PHP function). And one of the array element of this function is a element with key "dirname". Looks like you have some empty Urls. Do you have products with empty names (sometimes this happens if products was generated or imported programmatically)?

olegkoval commented 4 years ago

@Mairon001 Can you provide me access to your server or test server (ssh)? So, I can debug this (very interesting situation).

Mairon001 commented 4 years ago

Hello @Mairon001

In this file extension check a generated Url Rewrites and split them into parts by using "pathinfo()" (built-in PHP function). And one of the array element of this function is a element with key "dirname". Looks like you have some empty Urls. Do you have products with empty names (sometimes this happens if products was generated or imported programmatically)?

Imported from CSV - exported from Software not mine (thirdy part)

Mairon001 commented 4 years ago

@Mairon001 Can you provide me access to your server or test server (ssh)? So, I can debug this (very interesting situation).

I'm sorry but for reason of GDPR / Customer etc etc, i can't. but I can give you more info if you want, tomorrow I'll describe the rest, now I have to disconnect, it's late in Italy

Mairon001 commented 4 years ago

Hello @Mairon001

In this file extension check a generated Url Rewrites and split them into parts by using "pathinfo()" (built-in PHP function). And one of the array element of this function is a element with key "dirname". Looks like you have some empty Urls. Do you have products with empty names (sometimes this happens if products was generated or imported programmatically)?

Thanks for the support, I found the problem, during the import with CSV, he created products without the name attribute, this error occurs during the import when magento associates the URL Rewrites, if it finds an existing Url key, it creates the product but it does not matter the name, and therefore subsequently its generate bugs

olegkoval commented 4 years ago

Closed.