Câu 31: Magento 2 Certified Associate Developer
In a code review of a merchant's site you have discovered that there are multiple observers for the checkout_submit_all_after event. After closer inspection, you notice one of these observers is relying on the others being executed before it is called. What risk does this pose, and how can it be mitigated?
Nội dung câu hỏi
In a code review of a merchant's site you have discovered that there are multiple observers for the checkout_submit_all_after event. After closer inspection, you notice one of these observers is relying on the others being executed before it is called. What risk does this pose, and how can it be mitigated?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. There is no risk posed as long as each event observer specifies a correct sortOrder. Nothing needs to be changed.
- B. Event observers are fired in alphabetical order of the observer name. There is no risk here. — đáp án hiện tại
- C. Magento only supports one observer per event. These observers will need to be combined into a single point of customization.
- D. Order of listener execution cannot be guaranteed, resulting in a fragile implementation. This code should be re-worked using plugins
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.
Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.