[BUGFIX] alt_doc.php uses deleted alternative page languages for translations
authorMarcus Krause <marcus@t3sec.info>
Fri, 28 Oct 2011 14:39:22 +0000 (16:39 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Thu, 3 Nov 2011 17:51:44 +0000 (18:51 +0100)
The backend script alt_doc.php even considers deleted
pages_language_overlay records when determining in which language a
record can be/is localized.

This patch improves method documentation and applies
t3lib_BEfunc::deleteClause() on the respective database query.

Change-Id: I2f34cfb888a452136120b9e5d94cf2866b909fb1
Fixes: #31379
Releases: 4.3, 4.4, 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/6386
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/alt_doc.php

index 6ad9c9e..debee18 100644 (file)
@@ -1152,7 +1152,7 @@ class SC_alt_doc {
 
 
        /**
-        * Returns sys_language records.
+        * Returns sys_language records available for record translations on given page.
         *
         * @param       integer         Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user)
         * @return      array           Language records including faked record for default language
@@ -1180,7 +1180,7 @@ class SC_alt_doc {
                        $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                                                        'sys_language.*',
                                                        'pages_language_overlay,sys_language',
-                                                       'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid='.intval($id).$exQ,
+                                                       'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . intval($id) . t3lib_BEfunc::deleteClause('pages_language_overlay') . $exQ,
                                                        'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.static_lang_isocode,sys_language.flag',
                                                        'sys_language.title'
                                                );