Bug #22469
closedSwitching pages with browsebox dosn't work
0%
Description
When clicking a link in the indexed search browsebox these JavaScript error appears:
"Error: document.tx_indexedsearch is undefined"
This error depends on a change in the indexed search default template "/pi1/indexed_search.tmpl" that comes with TYPO3 4.3.3.
Here you can see the changed part, that causes the JS error:
TYPO3 4.3.3:
[...]
<form action="###ACTION_URL###" method="post" id="tx_indexedsearch">
[...]
TYPO3 4.3.2:
[...]
<form action="###ACTION_URL###" method="post" name="tx_indexedsearch">
[...]
Please notice that the attribute "name" changed to "id". There the element "document.tx_indexedsearch" is not available in the DOM.
(issue imported from #M14130)
Files
Updated by Mark Kuiphuis over 14 years ago
The "name" attribute in the form tag is not a valid XHTML attribute. In fact "id" should be used instead. But then also the file /typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php should be changed:
A possible solution:
Change in function makePointerSelector_link: (starting at line 1859)
$onclick = 'document.'.$this->prefixId.'[\''.$this->prefixId.'[pointer]\'].value=\''.$p.'\';'. 'document.'.$this->prefixId.'[\''.$this->prefixId.'[_freeIndexUid]\'].value=\''.rawurlencode($freeIndexUid).'\';'. 'document.'.$this->prefixId.'.submit();return false;';
into:
$onclick = 'document.getElementById(\'' . $this->prefixId . '_pointer\').value=\''.$p.'\';'. 'document.getElementById(\''.$this->prefixId . '_freeIndexUid\').value=\''.rawurlencode($freeIndexUid).'\';'. 'document.getElementById(\''.$this->prefixId. '\').submit();return false;';
and in the template: indexed_search.tmpl the following should be changed:
<input type="hidden" name="tx_indexedsearch[_freeIndexUid]" value="_" />
<input type="hidden" name="tx_indexedsearch[pointer]" value="0" />
into:
<input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
<input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" />
Sorry for the amount of code, I don't know how to create a patch file :-(
Updated by Ralf Hettinger over 14 years ago
Related to / could be solved with #1347
Updated by Markus Bucher over 14 years ago
As a workaround you can simply change the template from id="tx_indexedsearch" back to name="tx_indexedsearch"
Simple, but working ;-)
Using 4.4.0beta1
Updated by Christian Hernmarck over 14 years ago
or just add 'name="tx_indexedsearch"' to the form-tag...
Updated by Xavier Perseguers about 14 years ago
Committed to:
- trunk (rev. 7800)
- 4-3 (rev. 7801)
Updated by Fronzes Philippe over 12 years ago
Same kind of bug when one click on the header of a section.
add id="tx_indexedsearch_sections"
in template_css.tmpl
replace line 768 by:$onclick = 'document.getElementById(\'' . $this->prefixId . '_sections\').value=\'' . $theRLid . '\';' .
'document.getElementById(\'' . $this->prefixId . '\').submit();return false;';