fallback-patch.txt

Administrator Admin, 2009-06-16 17:57

Download (2.3 kB)

 
1
### Eclipse Workspace Patch 1.0
2
#P TYPO3
3
Index: typo3/sysext/cms/tslib/class.tslib_fe.php
4
===================================================================
5
--- typo3/sysext/cms/tslib/class.tslib_fe.php	(revision 5596)
6
+++ typo3/sysext/cms/tslib/class.tslib_fe.php	(working copy)
7
@@ -2258,6 +2258,7 @@
8
 								foreach($fallBackOrder as $orderValue)	{
9
 									if (!strcmp($orderValue,'0') || count($this->sys_page->getPageOverlay($this->id, $orderValue)))	{
10
 										$this->sys_language_content = $orderValue;	// Setting content uid (but leaving the sys_language_uid)
11
+										$this->page = $this->sys_page->getPageOverlay($this->page, $orderValue); // Get titles and other page info of current page in fallback language 
12
 										break;
13
 									}
14
 								}
15
Index: t3lib/class.t3lib_page.php
16
===================================================================
17
--- t3lib/class.t3lib_page.php	(revision 5596)
18
+++ t3lib/class.t3lib_page.php	(working copy)
19
@@ -306,6 +306,35 @@
20
 							'',
21
 							'1'
22
 						);
23
+
24
+					// When we have no result yet, check if there is fallback defined and try to find the page in the fallback language:
25
+				if($lUid == $this->sys_language_uid && $GLOBALS['TYPO3_DB']->sql_num_rows($res) == 0) {
26
+						
27
+					list($sys_language_mode,$sys_language_content) = t3lib_div::trimExplode(';', $GLOBALS['TSFE']->config['config']['sys_language_mode']);
28
+					if($sys_language_mode == 'content_fallback') {
29
+						$fallBackOrder = t3lib_div::intExplode(',', $sys_language_content);
30
+						foreach($fallBackOrder as $orderValue)	{
31
+							
32
+								// Selecting overlay record in fallback language:
33
+							$GLOBALS['TYPO3_DB']->sql_free_result($res);
34
+							$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
35
+										implode(',',$fieldArr),
36
+										'pages_language_overlay',
37
+										'pid='.intval($page_id).'
38
+											AND sys_language_uid='.intval($orderValue).
39
+											$this->enableFields('pages_language_overlay'),
40
+										'',
41
+										'',
42
+										'1'
43
+									);
44
+									
45
+							if($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
46
+								break;
47
+							}
48
+						}
49
+					}
50
+				}
51
+
52
 				$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
53
 				$GLOBALS['TYPO3_DB']->sql_free_result($res);
54
 				$this->versionOL('pages_language_overlay',$row);