Revert "Fix #5679 again after recent changes in core"

This reverts commit 2bfaacd17063ed52ceca53f55861acb7ff655c66.

Fixes #6821