Closed pioneerathletics closed 7 years ago
Please make sure your updated https://github.com/magento/magento2/blob/2.1.8/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js#L81 corresponds to the core version. Can you reproduced on a clean Magento 2.1.9 install? What kind of minicart customizations are made?
Hi there Vlad, Yes I have confirmed that the linked file you've provided is the same file I have in my system. I do not have any minicart customizations whatsoever. I've only had this issue when upgrading from 2.1.7 to 2.1.9 just within the last week. Interestingly enough I updated another store to 2.1.9 during the week of Sept. 22nd and didn't notice any issues.
When I did update this week, though, I noticed the difference was symfony had several updates that weren't there the week of Sept. 22nd.
Below is Sept. 22nd upgrade to 2.1.9 on a separate store `Updating dependencies (including require-dev) Package operations: 0 installs, 57 updates, 0 removals
And this is the update from this week on October 10th: `Updating dependencies (including require-dev) Package operations: 0 installs, 70 updates, 0 removals
I don't think composer packages could break it. Just search for "maxItemsToDisplay" all over the 2.1.9 vanilla code and your codebase to check if all of them in place. For example it can be missing in \Magento\Checkout\Block\Cart\Sidebar::getConfig
.
I'm not sure how I can check the entire codebase? How will I know where they are supposed to be?
In PhpStorm you can do it with Cmd+Shift+F, in terminal with grep -i maxItemsToDisplay
.
I see, I do not have PhpStorm-I'll have to look into it. It seems like the issue is related to this one? #4170
No, it was a different issue fix: https://github.com/magento/magento2/blame/2.1/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js#L81
Usually such error may occur if you override some core js
component or html
template so that after upgrade it does not contain all necessary functionality.
We had exactly the same problem yesterday, in the end our host fixed the issue for us. He "chrooted" in and then ran the following commands (altered slightly for non magestack environment).
rm -rf var/generation/* var/view_preprocessed/* pub/static/*
php bin/magento deploy:mode:set production
php bin/magento cache:flush; curl -X PURGE https://www.example.com/.*
We were in developer mode prior to running the commands and all cache was turned off. We must have ran these commands 20+ times during the day to try to solve the error so we aren't sure if the fact he "chrooted" in could have made the difference, although I think maybe varnish hadn't been purged properly before.
I hope it helps!
Thanks @fendowuk we'll have to give it a try. Actually I looked back at the exception.log and came across this:[2017-10-06 11:52:23] main.CRITICAL: RuntimeException: Source class "" for "Magento\Framework\App\Response\Http\Interceptor" generation does not exist. in /home/website/web-folder/vendor/magento/framework/Code/Generator.php:185
and also
[2017-10-06 11:54:16] main.CRITICAL: ReflectionException: Class Magento\MediaStorage\Model\File\Storage\Response\Interceptor does not exist in /home/website/web-folder/vendor/magento/framework/Code/Reader/ClassReader.php:19
Could it have been just an error in deploying the new version?
Hi @pioneerathletics I can't be sure, I think it is more than likely a cache issue. Are you using varnish? I would try enabling developer mode, disabling cache and running the commands above.
Hi @fendowuk no we're just using the built in cache (I had a lot of problems with disappearing nav menus with varnish). We are also on production mode, do you usually switch over to developer mode when you update?
Forgot to mention we're using Redis as well.
Hi @pioneerathletics I've just always done it, I guess there is no reason to. If you are in production mode just try running.
rm -rf var/generation/* var/view_preprocessed/* pub/static/*
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush
redis-cli flushall
If that doesn't work I'd try to run as root/chroot as it's the only other difference in what I was doing to what my host did.
Hi @pioneerathletics Did you help the last comment from fendowuk?
I haven't tried the suggestion yet. I am waiting until the weekend to attempt the upgrade because the last time I updated my minicart issue started and I was forced to restore from a backup that took our store offline during business hours.
@pioneerathletics Thanks for the feedback. Please update after you try last proposal.
I saw same issue after upgrade from 2.1.7 to 2.19
rm -rf var/generation/* var/view_preprocessed/* pub/static/*
solved the issue for me
(default mode)
So I tried updating again from 2.1.7 to 2.1.9., in production mode, and yet again I've had the same mini-cart issue. I tried the suggestions from @fendowuk and at first glance they didn't work. I had to manually clear my browser cache in order for the changes to apply (Chrome, Safari, Safari iOs) .
@magento-engcom-team why would this issue still be persistent, except for when I manually cleared my browser cache? It wouldn't be a big deal, but if a repeat customer visits the store again and the mini-cart is not functioning how would they know to clear their browser cache and cookies?
@pioneerathletics are you able to reproduce this problem on a clean Magento 2.1.7 installation ("clean" in terms of modules/themes, it can contain any data and/or official sample data) when it is upgraded to 2.1.9?
Hi @pioneerathletics Are you able to reproduce this problem on a clean Magento 2.1.7 installation ("clean" in terms of modules/themes, it can contain any data and/or official sample data) when it is upgraded to 2.1.9?
Hi @pioneerathletics
I also had the same issue with having to clear browser cache before seeing the changes. Sorry, I should have also said that initially.
I have however just realised that the .htaccess file in pub/static/.htaccess was missing. I am wondering if this could have been the cause, do you have that file on your site?
Same issue here. Tried all of the above, still no functioning minicart.
PHP 7.0 and 7.1 Mysql 5.7 Magento CE 2.1.9
I figured out that once created an override for minicart.js and it didn't get updated like @orlangur mentioned
No, it was a different issue fix: https://github.com/magento/magento2/blame/2.1/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js#L81 Usually such error may occur if you override some core js component or html template so that after upgrade it does not contain all necessary functionality.
I checked the difference between the files (original in vendor folder and custom in app/design) (using diffchecker.com) to see what happened and updated the override.
After that I followed @fendowuk's advice:
We had exactly the same problem yesterday, in the end our host fixed the issue for us. He "chrooted" in and then ran the following commands (altered slightly for non magestack environment).
rm -rf var/generation/ var/view_preprocessed/ pub/static/ php bin/magento deploy:mode:set production php bin/magento cache:flush; curl -X PURGE https://www.example.com/.
We were in developer mode prior to running the commands and all cache was turned off. We must have ran these commands 20+ times during the day to try to solve the error so we aren't sure if the fact he "chrooted" in could have made the difference, although I think maybe varnish hadn't been purged properly before.
I hope it helps!
To finish it all I cleared local browser cache and looked again and guess what? It solved my problem.
So, the only advice I'm missing in here is:
go to root folder of Magento in terminal and enter find . -name minicart.js
and see if there are customized versions of this file. If so, check if maxItemsToDisplay
exists and add it there using https://github.com/magento/magento2/blame/2.1/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js if needed.
@pioneerathletics, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.
Preconditions
Steps to reproduce
Expected result
Actual result
Uncaught ReferenceError: Unable to process binding "if: function (){return getCartParam('summary_count') }" Message: Unable to process binding "if: function (){return maxItemsToDisplay < getCartLineItemsCount() }" Message: maxItemsToDisplay is not defined at if (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:55) at ko.computed.disposeWhenNodeIsRemoved (knockout.js:3989) at evaluateImmediate (knockout.js:1737) at Object.ko.computed.ko.dependentObservable (knockout.js:1946) at init (knockout.js:3988) at knockout.js:2989 at Object.ignore (knockout.js:1249) at knockout.js:2988 at Object.arrayForEach (knockout.js:151) at applyBindingsToNodeInternal (knockout.js:2974)