Skip to content

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

Closed
@bytes-commerce

Description

@bytes-commerce

Preconditions

  1. Using Magento 2.2.4
  2. PHP 7.0.30

Steps to reproduce

  1. Create new module
  2. Create di.xml, events.xml, crontab.xml additionally to needed module.xml
  3. Fill all files correctly with its nessecary headers but dont put any children in it
    Example for di.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
</config>

  1. run php bin/magento setup:upgrade && php bin/magento cache:flush && php bin/magento cache:clean

Expected result

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

Actual result

  1. Upgrade runs fine, Cache Flush triggers the error (cache:clean does not)
  2. Error Message:
  [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        

This is not logically as it should render fine, process the file even with no config in it, as it process other files.

Metadata

Metadata

Labels

Component: Framework/EventFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasegood first issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions