magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

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

Open m2-assistant[bot] opened this issue 1 year ago • 2 comments

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 (*)

  • [X] Pull request has a meaningful description of its purpose
  • [X] All commits are accompanied by meaningful commit messages
  • [X] All new or changed code is covered with unit/integration tests (if applicable)
  • [X] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [X] All automated tests passed successfully (all builds are green)

m2-assistant[bot] avatar Mar 12 '24 11:03 m2-assistant[bot]

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:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • [ ] 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • [ ] 5. Add label Issue: Confirmed once verification is complete.
  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Apr 08 '24 08:04 m2-assistant[bot]

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.

engcom-November avatar Apr 08 '24 08:04 engcom-November