Implement https://github.com/joomla/joomla-cms/pull/3200 again