0

Thanks for reading.

I've been working on a Magento2 project for the past couple months. Recently we updated from 2.3.0(or 2.3.1, I can't remember) to 2.3.5. Sadly, this caused more bad than good. Custom modules stopped working but after debugging I was able to get most of them working again. One example is the templatevars when creating an email with transportbuilder in a controller, appearently somewhere in the last few updates the 'store' variable in templatevars was deprecated since its already in templateoptions, but this issue was nowhere to be found on the internet which let to extreme frustration. It kept giving me a 'cannot use a scalar value as an array' error in abstracttemplate.php. From now on I will not update Magento again until its really necessary..

However, there is one problem that I haven't been able to fix. Its not about a custom module but rather a part of the Magento Core itself. I'm talking about the success/error messageboxes when, for example, you add an item to the cart. They popup fine, but I can't close them. Both the cross button and the 5 second timer are not working. Lets make one thing clear though; I've been reading other threads with people having the same problem saying that the messagebox stays when going to another page, but this is not the case for me. After I leave the page or refresh, they do disappear.

So I've tried the following things:

  • Disabling full page cache
  • Tried the messageboxes on every page, yet I get the same results no matter where I use them, So its not page-related.
  • Debugging in message.js

So, I've been logging to the console in every function in the message.js file. The function where the 5 sec timer gets activated does not even trigger at all unless I call it in the 'initialize' function myself. Lets look at the function that I'm talking about:

        onHiddenChange: function (isHidden) {
            var self = this;

            // Hide message block if needed
            if (isHidden) {
                setTimeout(function () {
                    $(self.selector).hide('blind', {}, 500);
                }, 5000);
            }
        }

So, just like I said, I called it myself and it does run. However, the boolean 'isHidden' never turns to true, so the timeout never gets activated. So I commented that out aswell, but then my logs do get called, but still, the message never disappears. The timeout works fine but the $(self.selector).hide('blind', {}, 500); doesn't.

I have no clue at this moment.. Hopefully anyone can help me out or atleast push me in the right direction.

Thanks in advance!

1 Answer 1

0

Dealing with the identical issue now. Have played with the databind function, but that seems to simply ignore the message instead of dismissing it.

I moved on to class="messages" data-bind="click: removeAll"> to add functionality but had no success.

Did you find a method?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.