-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Warning: Illegal offset type in /www/magento2/xxx/app/code/Magento/Catalog/Model/CategoryRepository.php on line 133 #5475
Comments
I try to bypass this problem, by commenting out the two lines in file /www/magento2/xxx/app/code/Magento/Catalog/Model/CategoryRepository.php
But another problem happens |
|
@yssource thank you for your report. |
According to contributor guide, tickets without response for two weeks should be closed. |
Have the same problem after upgrading to Magento 2.1.0 from 2.0.7, anyone actually figure out what was going on here? |
I have the same issue - is there a link to a resolution. M2.1.0. |
@elrondb @davidaddison since this ticket is closed i doubt there will be much attention. If you are having this issue though please file a new ticket and provide full information in terms of version used, system information, and steps to reproduce so we can investigate. |
Hi I am also facing the same issue when I am trying to call Featured products in product detail page. Exception #0 (Exception): Warning: Illegal offset type in vendor/magento/module-catalog/Model/CategoryRepository.php on line 133 |
@kiranmaip Same issues here, how did you fix? |
@giusecapo I didn't find any solution till now searching for that |
kindly disable Page Cache in your cache management, and check the issue again. |
Same issue here. is there any other fix other than disabling page cache ? |
I have the same issue, I have three store views in this case |
Same problem using Magento 2.1.5 Theses problems didn't occur with default product attributes/category/attribute sets after a clean installation. |
Magneto version: community edition 2.1.6 Having a look at the current development branch this bug seems to be fixed with this commit 2b06a48 The error message seems to happen when the setCategoryId() method is called with something inappropriate. In the case of the 'Magento\Catalog\Block\Product\ListProduct' block it was trying to use setCategoryId() by passing it an object 'Magento\Catalog\Model\Category\Interceptor' instead of an integer representing the category ID. 'Magento\Catalog\Model\CategoryRepository' was than throwing an error when trying to use the value set via setCategoryId() in a array cache lookup. I suspect it will be a similar bug regarding other peoples situations so hopefully the Magento devs have caught these occurrences and the fixes will be in the next release. |
@codekipple They have not. Just tried the same thing and got the same error in CE 2.1.7, one presumes for the same reason. sigh It is quite frustrating how many already fixed bugs I hit in the releases. |
I got it in CE 2.1.7 as well. |
The fix is tagged with 2.2.0-RC1.4 so it looks like it's coming with 2.2.0, I ended up just creating my own block for now instead of trying to use 'Magento\Catalog\Block\Product\ListProduct' |
vendor/magento/module-catalog/Block/Product/ListProduct.php The above changes resolved the issue for me. |
thankyour @iamkdev , |
I have this problem with amasty shopby module on magento 2.2 and category filter activated, i found the problem in "get" function, in fact this function expect an int parameters how categoryId, but in my case it receive an array.
I know this isn't definitive solutions and change core isn't a good idea, i continue to investigate with amasty to resolve the problem. |
@elachino - Which file you have added if(is_array($categoryId)){ $categoryId = $categoryId[0]; } this line. Please guide me. |
@sasilinux - I added this string in code/Magento/Catalog/Model/CategoryRepository.php, but i found the problem in amasty module finally.
But it didn't work on Magento 2.2, i found solution changed it with:
I don't know if you have same issue, but if my first update works for you, i suggest to search error in categoryfilters. |
@elachino - Thanks for the update. But in which amasty file you have changed it to the following line: $productCollection->addCategoriesFilter(['in' => $categoryIds]); Beacuse i am also using Magento 2.2 with amasty. |
@sasilinux - i posted update to amasty and they fix it in new module version. If you prefer, below you find all: We changed code in app/code/Amasty/Shopby/Model/Layer/Filter/Category.php
with
|
@elachino - It is working for me. Thanks a lot. |
@elachino - After placing the above code. Category filter is working fine but other attribute filters are not working. |
@sasilinux - i don't think my code break other filter working, we have change only Layer/Filter/Category, did you try if without my code other filters working? |
@elachino - Sorry now it is working. It was occurred due to other stuff. Thanks. Also, if you have any suggestions to improve the site performance and search performance via mysql or any other thing. Please guide me. Thanks in advance. |
Hello,
can you please unsubscribe our Mail-Address [email protected]
Thank you and best regards,
elektro-plus GmbH
Martin Graf
Von: sasilinux [mailto:[email protected]]
Gesendet: Freitag, 27. Oktober 2017 13:47
An: magento/magento2
Cc: Subscribed
Betreff: Re: [magento/magento2] Warning: Illegal offset type in /www/magento2/xxx/app/code/Magento/Catalog/Model/CategoryRepository.php on line 133 (#5475)
@elachino <https://github.com/elachino> - Sorry now it is working. It was occurred due to other stuff. Thanks. Also, if you have any suggestions to improve the site performance and search performance via mysql or any other thing. Please guide me. Thanks in advance.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#5475 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AFoiZ2ZJv55mnO_jmIAJptjWeyWgLvv4ks5swcKKgaJpZM4JFIDT> . <https://github.com/notifications/beacon/AFoiZwXVbC-bASyjsginVSkYdzmTnTy9ks5swcKKgaJpZM4JFIDT.gif>
|
Still Got the Error on 2.3 Version as well. any way to resolve it? |
Is it fine to customize the core code from the Magento? not a good approach |
[TSG] TESTs Fixes for 2.4 (pr21) (2.4-develop)
It seems that the issue is related to multi stores and multi views.
If you have the default store view ONLY, then the error won't be found and you will be redirected to the product page view, and it works fine.
But, if you add a new store view whether it's enabled or disabled, the issue will appear and the error will be found.
This related to another similar issue #4018
The text was updated successfully, but these errors were encountered: