Skip to content

Add availability to leave empty config for events.xml #19145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

lisovyievhenii
Copy link
Contributor

@lisovyievhenii lisovyievhenii commented Nov 10, 2018

Description (*)

The node in events.xml file cannot have no any children nodes.

Fixed Issue

#15931: events.xml cant have no childrens, others can [Magento 2.2.4]

Manual testing scenarios (*)

  1. Create new module
  2. Create events.xml
  3. Fill with only base node "" without any children
  4. Run php bin.magento cache:flush

Expected result

Upgrade + Flush + Clean should run fine trough, page is loading afterwards in developer mode

Actual result

Cache Flush triggers the error:

  [Magento\Framework\Exception\LocalizedException]                               
  Invalid XML in file /var/www/html/app/code/Vendor/Modulename/etc/events.xml:  
  Element 'config': Missing child element(s). Expected is ( event ).             
  Line: 2

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)
  • All automated tests passed successfully (all builds on Travis CI are green)

Backport for: #19146

@lisovyievhenii lisovyievhenii added the Partner: ISM eCompany Pull Request is created by partner ISM eCompany label Nov 10, 2018
@magento-engcom-team magento-engcom-team added the partners-contribution Pull Request is created by Magento Partner label Nov 10, 2018
@magento-engcom-team
Copy link
Contributor

Hi @lisovyievhenii. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.2-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@lisovyievhenii
Copy link
Contributor Author

The branch name was incorrectly named. Don't pay attention on it

@arnoudhgz
Copy link
Contributor

@magento-engcom-team please consider that this will make the code less strict. I already mentioned that in the issue that it is not really an issue. To me it makes no sense to make the code less strict, just for debugging.

@lisovyievhenii
Copy link
Contributor Author

@arnoudhgz all other xsd schemas support an empty configuration. So it makes sense to add this fix into events.xsd schema, to make it similar to others

@arnoudhgz
Copy link
Contributor

arnoudhgz commented Nov 10, 2018

@lisovyievhenii I think the others should be made more strict...

But it is not my call, I just want it here as a side note for the reviewer, since Magento never replied on my issues with this in the issue.

Sorry, accidentally clicked the close button, reopened again 👍

@lisovyievhenii
Copy link
Contributor Author

Could you please re-run tests or say why it was failed?

@rogyar
Copy link
Contributor

rogyar commented Nov 30, 2018

I'm going to re-run the tests internally.

@magento-engcom-team
Copy link
Contributor

Hi @lisovyievhenii. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/Event Partner: ISM eCompany Pull Request is created by partner ISM eCompany partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants