Closed erfanimani closed 1 year ago
Hi @erfanimani. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
@magento I am working on this
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @erfanimani,
Thanks for the report and collaboration!
We agree with your point and saw the attached PR as well. But can you please provide us with some steps to reproduce this issue? It will help us in the fast movement of this issue.
Thanks
Hi @engcom-Hotel, could you clarify what you mean? This is a developer/customisation/code improvement — there's no end-user issue associated with this ticket.
Hi @erfanimani,
What I mean to say is, in order to confirm the issue we need some proper steps to reproduce this issue. After confirmation on this ticket, a JIRA will create, and that JIRA will process further.
Thanks
Hi @engcom-Hotel, I'm not sure how relevant the steps to reproduce are for this ticket, but it would go something like this:
Expected result:
cookieMessages
Actual result:
As mentioned, this is not an end user bug but an internal improvement.
Hello @erfanimani,
Thanks for the reply and coordination!
We are able to reproduce the issue. In order to reproduce the issue, we have created the mixin. The same has been attached below for reference:
Hence confirming the issue.
Thanks
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-8854 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
The issue was fixed in https://github.com/magento/magento2/commit/38b8b516489a6e436177c59f61ec5903cd8552c5 (changes from https://github.com/magento/magento2/pull/37309)
Summary
Common customizations of Magento include creating a hide or close button for customer messages, and having it automatically disappear after a certain amount of seconds.
The right way to approach this is to modify the application state. In this case it would be necessary for developers to modify the messages array, which should cause the UI to be rerendered by Knockout's dual way data-binding. This is often done through a JS mixin that extends the
messages.js
UI Component.At the moment this is not possible. The
cookieMessages
array is not an observable attribute and the UI does not react to any changes.(Also see Example 1 in the official documentation: https://knockoutjs.com/documentation/foreach-binding.html)
My suggestion is convert the cookieMessages into an observable attribute, so that developers are able to manipulate the state causing a proper UI rerender.
Examples
messages-mixin.js
:At the moment, manipulating the
cookieMesssages
attribute does not cause the UI to be updated.However, in-line with Magento philosophy, we would like the state to be reflected in the UI by using an observable instead. This is expected behaviour:
messages-mixin.js
:Proposed solution
Convert cookieMessages into an observable. Unfortunately the fix for this will necessarily be backwards incompatible for merchants that have overwritten
vendor/magento/module-theme/view/frontend/templates/messages.phtml
.I will create a PR.
edit: https://github.com/magento/magento2/pull/37309
Release note
No response
Triage and priority