Skip to content

Can't access backend indexers page after creating a custom index #21510

Closed
@ccasciotti

Description

@ccasciotti

After complete all the steps to create a new custom index as described in the official devdoc guide (https://devdocs.magento.com/guides/v2.2/extension-dev-guide/indexing-custom.html)
if you go on admin's indexer list page a fatal error is thrown due to a partially wrong implementation of Magento\Indexer\Model\Indexer::getLatestUpdated method called by Magento\Indexer\Model\Indexer\DependencyDecorator::getLatestUpdated.
The result of the DependencyDecorator::getLatestUpdated must be a string, but the Indexer::getLatestUpdated method returns null the very first time you access that backend page because no view is yet present.

Preconditions (*)

  1. Magento 2.2.7 (both community or commerce)

Steps to reproduce (*)

  1. Implementation of a custom index as the guide: https://devdocs.magento.com/guides/v2.2/extension-dev-guide/indexing-custom.html
  2. Login to backend
  3. Go to System > Index Management

Expected result (*)

  1. A successful response with the list of indexers
    image

Actual result (*)

  1. A fatal error with this exception:
    PHP Fatal error: Uncaught TypeError: Return value of Magento\\Indexer\\Model\\Indexer\\DependencyDecorator::getLatestUpdated() must be of the type string, null returned in <magento_root>/vendor/magento/module-indexer/Model/Indexer/DependencyDecorator.php:240

Metadata

Metadata

Assignees

Labels

Component: IndexerFixed 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 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions