magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.45k stars 9.29k forks source link

[Issue] Extend Observer declaration in events.xml by new attribute ifconfig #38514

Open m2-assistant[bot] opened 5 months ago

m2-assistant[bot] commented 5 months ago

This issue is automatically created based on existing pull request: magento/magento2#38493: Extend Observer declaration in events.xml by new attribute ifconfig


Description (*)

Extension of Observer declaration in events.xml by new optional attribute ifconfig with appropriate handling of it. Similar to usage of ifconfig in layout's xml files - it executes (or not) Observer depending on boolean value of given config path. The purpose is to condition Observer's execution on config paths representing module's state - usually <module/general/active> or <module/general/enabled> etc.

Manual testing scenarios (*)

  1. Add ifconfig attribute to Observer A declaration in events.xml file where its value will be config path and dispatch event to trigger Observer. a) When config path value equals to true - Observer should execute. b) When config path value equals to false - Observer should not execute c) When config does not exist (path does not represent any actual value) - Observer should not execute
  2. Add ifconfig attribute to Observer A declaration in events.xml file where its value is empty string "" and dispatch event to trigger Observer. Observer should execute.

Contribution checklist (*)

m2-assistant[bot] commented 4 months ago

Hi @engcom-November. 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:

engcom-November commented 4 months ago

Hello @bartekAtconvert,

Thank you for the report and collaboration!

As you are adding a new attribute ifconfig to events.xml, so that the observer's execution can be conditioned. This can be considered as a feature request. Hence marking it the same.

Thank you.