Skip to content

Cache type without "instance" causes exception when disabling the module through "Cache Management" in the backend #26224

Closed
@Serializator

Description

@Serializator

Preconditions (*)

  1. Magento 2.3.3 CE

Steps to reproduce (*)

  1. Create a cache type using "cache.xml" without the "instance" argument
<config .../>
    <type name="exceptional_cache_type">
        <label>Exceptional Cache Type</label>
        <description>An exceptional cache type using a quantum computer</description>
    </type>
</config>
  1. Go to "System > Cache Management" in the backend
  2. Check the checkbox of the cache type "Exceptional Cache Type"
  3. Select "Disable" and click "Submit"

Expected result (*)

I'd expect the cache type to be successfully disabled.

According to the XSD ("lib/internal/Magento/Framework/Cache/etc/cache.xsd") the "instance" argument is optional and not required.

Actual result (*)

It throws an exception because it's trying to invoke ->clean(...) on a null variable.

Fatal error: Uncaught Error: Call to a member function clean() on null in /lib/internal/Magento/Framework/App/Cache/TypeList.php:194 Stack trace:
#0 /app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php(62): Magento\Framework\App\Cache\TypeList->cleanType('invalid_cache_t...')
#1 /app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php(41): Magento\Backend\Controller\Adminhtml\Cache\MassDisable->disableCache()
#2 /generated/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable/Interceptor.php(24): Magento\Backend\Controller\Adminhtml\Cache\MassDisable->execute()
#3 /lib/internal/Magento/Framework/App/Action/Action.php(107): Magento\Backend\Controller\Adminhtml\Cache\MassDisable\Interceptor->execute()

Metadata

Metadata

Assignees

Labels

Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is validGate 1 Passed. Automatic verification of issue format passedReported on 2.3.3Indicates original Magento version for the Issue report.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions