diff --git a/build/media_source/system/js/searchtools.es6.js b/build/media_source/system/js/searchtools.es6.js index 880ebcfb16fb1..262976224df02 100644 --- a/build/media_source/system/js/searchtools.es6.js +++ b/build/media_source/system/js/searchtools.es6.js @@ -529,10 +529,11 @@ Joomla = window.Joomla || {}; } const sort = document.getElementById('sorted'); + const order = document.getElementById('orderedBy'); - if (sort && sort.hasAttribute('data-caption')) { + if (sort && sort.hasAttribute('data-caption') && order) { const orderedBy = sort.getAttribute('data-caption'); - document.getElementById('orderedBy').textContent += orderedBy; + order.textContent += orderedBy; } if (sort && sort.hasAttribute('data-sort')) {