Fixed bug #17045: Live Search uses id=0 to display all search results to non-admin...
authorJeff Segars <jsegars@alumni.rice.edu>
Sat, 22 Jan 2011 15:33:30 +0000 (15:33 +0000)
committerJeff Segars <jsegars@alumni.rice.edu>
Sat, 22 Jan 2011 15:33:30 +0000 (15:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10254 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/backend.php
typo3/js/livesearch.js

index 97fe41c..aec98f6 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2011-01-22  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Fixed bug #16680: Deactivate live search if list module is not available
+       * Fixed bug #17045: Live Search uses id=0 to display all search results to non-admin users
 
 2011-01-22  Susann Moog  <typo3@susanne-moog.de>
 
index 06f2afb..0ba2219 100644 (file)
@@ -599,7 +599,8 @@ class TYPO3backend {
                        'ContextHelpWindows' => array(
                                'width' => 600,
                                'height' => 400
-                       )
+                       ),
+                       'firstWebmountPid' => intval($GLOBALS['WEBMOUNTS'][0]),
                );
                if ($GLOBALS['LANG']->charSet !== 'utf-8') {
                        $t3Configuration['username'] = $GLOBALS['LANG']->csConvObj->conv($t3Configuration['username'], $GLOBALS['LANG']->charSet, 'utf-8');
index fa46341..cead0e1 100644 (file)
@@ -31,7 +31,7 @@ TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
        autoSelect: false,
        ctCls: 'live-search-results',
        dataProvider: null,
-       dbListUrl : 'id=0&search_levels=4&search_field=',
+       searchResultsPid : 0,
        displayField: 'title',
        emptyText: null,
        enableKeyEvents: true,
@@ -100,7 +100,7 @@ TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
                                if (this.dataReader.jsonData.pageJump != '') {
                                        jump(this.dataReader.jsonData.pageJump, 'web_list', 'web');
                                } else {
-                                       TYPO3.ModuleMenu.App.showModule('web_list', this.dbListUrl + this.getValue());
+                                       TYPO3.ModuleMenu.App.showModule('web_list', this.getSearchResultsUrl(this.getValue()));
                                }
                        }
                },
@@ -178,7 +178,7 @@ TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
                                                        // go to db_list.php and search for given search value
                                                        // @todo the current selected page ID from the page tree is required, also we need the
                                                        // values of $BE_USER->returnWebmounts() to search only during the allowed pages
-                                               TYPO3.ModuleMenu.App.showModule('web_list', this.dbListUrl + this.getValue());
+                                               TYPO3.ModuleMenu.App.showModule('web_list', this.getSearchResultsUrl(this.getValue()));
                                                this.collapse();
                                        }
                                }
@@ -279,6 +279,10 @@ TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
                TYPO3.BackendLiveSearch.superclass.reset.apply(this, arguments);
        },
 
+       getSearchResultsUrl : function(searchTerm) {
+               return 'id=' + this.searchResultsPid + '&search_levels=4&search_field=' + searchTerm;
+       },
+
        addIframeListeners : function () {
                // Add an event handler to each iframe, closing the search window when there's a click inside the iframe
                // @todo Is there a cleaner way to handle this?
@@ -315,7 +319,8 @@ Ext.onReady(function() {
                helpTitle: TYPO3.LLL.liveSearch.helpTitle,
                emptyText: TYPO3.LLL.liveSearch.emptyText,
                loadingText: TYPO3.LLL.liveSearch.loadingText,
-               listEmptyText: TYPO3.LLL.liveSearch.listEmptyText
+               listEmptyText: TYPO3.LLL.liveSearch.listEmptyText,
+               searchResultsPid: TYPO3.configuration.firstWebmountPid
        });
 
        TYPO3LiveSearch.applyToMarkup(Ext.get('live-search-box'));