Fix bugs arising from joomla code #29922

(PR #959).