Skip to content

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

Open
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #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 (*)

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

Metadata

Metadata

Labels

Priority: P3May be fixed according to the position in the backlog.Progress: PR in progressReported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itfeature request

Type

No type

Projects

Status

Pull Request in Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions