-
Notifications
You must be signed in to change notification settings - Fork 6
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
Exception if target_path or request_path are exceeding 255 characters #30
Comments
@wagnert How shall we proceed with this? We can have a look at it if you confirm that we just should cut-off the URL key? Or do you think it's more complicated? |
I tried in \TechDivision\Import\Utils\UrlKeyUtil::makeUnique
But in the second call to this function $urlPaths() is empty, so the resulting URL key does not get shortened there. Not sure it that is to overengineered ... I mean at the end of the day, it depends on how deep the categories are nested in the catalog. It's not easy to solve. We could as well just limit product URL keys to x characters, maybe using a setting. |
We decided in our case to limit the product URL key to 40 letters, so the problem is avoided in most of the cases. Imaging you have super long category names which are combined already more than 255 letters -> there will be no space for the product name (and also not for the incremental numbers). One approach could be to iteratively shorten the category names as well in such cases, but this is quite some algorithmic challenge and there might be no one-fits-all solution for this. |
@amenk We've that problem with one of our customers also, so we've to find generic solution for sure. But as you mentioned, it'll no be trivial. I'm happy to hear, that you've a temporary solution. I'll let the issue open and put it on the board during one of the next sprints. Thanks for supporting. |
Describe the bug
When importing products with a (very) long category path and url key (together exceeding 255 characters) it will end up in an SQL exception since
request_path
andtarget_path
in theurl_rewrites
table areVARCHAR(255)
.To Reproduce
Steps to reproduce the behavior:
vendor/bin/import-simple import:create:ok-file && vendor/bin/import-simple import:products
url_key
of the de_de entry e.g. adding a number or replacing a character and import againvendor/bin/import-simple import:create:ok-file && vendor/bin/import-simple import:products
Expected behavior
To be decided. Maybe following Magento and cutting off the end?
Additional context
Tested with revision 381fd2e
The text was updated successfully, but these errors were encountered: