Fix bugs arising from joomla code #29922

issues arise from #959