[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)
committerTolleiv Nietsch <info@tolleiv.de>
Sat, 14 Jan 2012 15:16:21 +0000 (16:16 +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: I922ca2e5465b41ab40fcad42acc22fa2805dcfc4
Fixes: #31379
Releases: 4.3, 4.4, 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/6374
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
typo3/alt_doc.php

index baa4fb6..35d9791 100644 (file)
@@ -1202,7 +1202,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
@@ -1232,7 +1232,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'
                                                );