Move PR 2822 from master to staging

On request of  Bakual, I have more the PR 2822
https://github.com/joomla/joomla-cms/pull/2822

from master to staging branch