Fix #5679 again after recent changes in core
Merge pull request #6448 from jirutka/fix-5679-2

Fix #5679 again after recent changes in core