Support

Admin Tools

#10005 Ajax Search

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 18 October 2011 09:00 CDT

user44547
Mandatory information about my setup:
PHP 5.2.17
Joomla 1.5.23
Admin Tools 2.1.5
Yootheme Zoo 2.4.14
MySQL 5.1.49

Description of my issue:
Hi,
I'm using an yootheme template (Enterprise) on my site with the latest Zoo Framework. The template comes with a nice, zoo supported, ajax search. But as soon as I enable the Admin Tools Plug in, the ajax search stops working.

The Chrome Console shows the following Error:
Uncaught SyntaxError: Unexpected token < js.php:78

Here is the complete Line 78:
return String(obj);},evaluate:function(str,secure){return(($type(str)!='string')||(secure&&!str.test(/^("(\\.|[^&quot;\\\n\r])*?"|[,:{}[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval('('+str+')');}};Json.Remote=XHR.extend({initialize:function(url,options){this.url=url;this.addEvent('onSuccess',this.onComplete);this.parent(options);this.setHeader('X-Request','JSON');},send:function(obj){return this.parent(this.url,'json='+Json.toString(obj));},onComplete:function(){this.fireEvent('onComplete',[Json.evaluate(this.response.text,this.options.secure)]);}});var Asset=new Abstract({javascript:function(source,properties){properties=$merge({'onload':Class.empty},properties);var script=new Element('script',{'src':source}).addEvents({'load':properties.onload,'readystatechange':function(){if(this.readyState=='complete')this.fireEvent('load');}});delete properties.onload;return script.setProperties(properties).inject(document.head);},css:function(source,properties){return new Element('link',$merge({'rel':'stylesheet','media':'screen','type':'text/css','href':source},properties)).inject(document.head);},image:function(source,properties){properties=$merge({'onload':Class.empty,'onabort':Class.empty,'onerror':Class.empty},properties);var image=new Image();image.src=source;var element=new Element('img',{'src':source});[&#039;load&#039;,&#039;abort&#039;,&#039;error&#039;].each(function(type){var event=properties[&#039;on&#039;+type];delete properties[&#039;on&#039;+type];element.addEvent(type,function(){this.removeEvent(type,arguments.callee);event.call(this);});});if(image.width&&image.height)element.fireEvent('load',element,1);return element.setProperties(properties);},images:function(sources,options){options=$merge({onComplete:Class.empty,onProgress:Class.empty},options);if(!sources.push)sources=[sources];var images=[];var counter=0;sources.each(function(source){var img=new Asset.image(source,{'onload':function(){options.onProgress.call(this,counter);counter++;if(counter==sources.length)options.onComplete();}});images.push(img);});return new Elements(images);}});var Hash=new Class({length:0,initialize:function(object){this.obj=object||{};this.setLength();},get:function(key){return(this.hasKey(key))?this.obj[key]:null;},hasKey:function(key){return(key in this.obj);},set:function(key,value){if(!this.hasKey(key))this.length++;this.obj[key]=value;return this;},setLength:function(){this.length=0;for(var p in this.obj)this.length++;return this;},remove:function(key){if(this.hasKey(key)){delete this.obj[key];this.length--;}


Any Idea whats going wrong? Is there an Admin Tools option need to turn off?
If i disable the Admin Tools Plug in, the search works just fine ... Does the order of the yoo_search and Admin Tools Plug in play a role?

If you need to see it live, I can mail you the URL by via PM.

Thanks so far for the great work!
Patrick

nicholas
Akeeba Staff
Manager
You have to allow direct access to the js.php file according to out troubleshooting guide. If you can not determine the proper exceptions yourself, please let me know of the URL of the page where this problem can be replicated and I will give you step by step instructions regarding what you have to do.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user44547
Hi Nicholas,

thanks for the fast Feedback. Allowing direct access to the js.php was the first thing I already did after reading the TSG.

It's definitely NOT the .htaccess File, that causes the Problem.
I can even remove or exchange it with my old one, and the error exists as long as the Admin Tools Plug in is active in the Backend.

nicholas
Akeeba Staff
Manager
Can you give me the URL to your site? If you don't want to share it over the public forum, feel free to send me a Personal Message, also mentioning the URL to this thread.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager
Thank you for your PM! It's now evident what is going on. The request is using tmpl=raw which is, by default, forbidden by Admin Tools' Web Application Firewall. You can work around that very easily, though. Go to Component, Admin Tools, Web Application Firewall, Configure WAF and modify the "List of allowed tmpl= keywords" to read
component,system,raw
then click on Save. That should do the trick :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user44547
THANKS for the outstanding support!
That did it!

nicholas
Akeeba Staff
Manager
You're welcome :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user12001
Had the same problem. Thanks Nicholas

nicholas
Akeeba Staff
Manager
You're welcome :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!