From 445f24c4584783f72b28974c2a4551183aa036bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sala=C3=BCn?= Date: Tue, 6 Nov 2018 23:41:08 +0100 Subject: [PATCH 1/2] sys_category_record_mm If using the sys_category_record_mm table, "uid_foreign" and "uid_local" must be inverted and the matching of the tablename and fieldname must be checked. Usage : news { # uid is NECESSARY in the sqlSelect field sqlMainTable = tx_news_domain_model_news # if catList depends of column of sqlMainTable (Column name like city or country) sqlCatColumn = categories # if catList depends on sqlMMTable (Only works if uid_foreign and uid_local is in use) sqlMMTable = sys_category_record_mm # order of the XML output sqlOrder = datetime DESC # last modified timestamp column (inside of sqlMainTable) sqlLastUpdated = tstamp # sql column of the title sqlTitle = title # sql column of keywords sqlKeywords = keywords # frequency frequency = # typolink additionalParam (must belong to the uid of the sqlMainTable) linkParams = tx_news_pi1[news] # csv Pid's of the stored elements. Rootline is not checked with this setting pidList = 1,2,3 # detail page id where the link should point at singlePid = 15 # filter by category which is inside of the main table -> sqlCatColumn catList = # csv filter by mm related table -> sqlMMTable catMMList = 3 # disable the language check through GLOBALS['TSFE']->sys_language_uid disableLanguageCheck = 0 } --- class.tx_ddgooglesitemap_dmf.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/class.tx_ddgooglesitemap_dmf.php b/class.tx_ddgooglesitemap_dmf.php index 538d3db..4d8bba7 100755 --- a/class.tx_ddgooglesitemap_dmf.php +++ b/class.tx_ddgooglesitemap_dmf.php @@ -94,6 +94,11 @@ protected function generateSitemapContent() { if ($mmTable != '' && count($catMMList) > 0 && $catMMList[0] > 0) { $sqlMMTable = ',' . $mmTable; $sqlMMCondition = ' AND ' . $table . '.uid = ' . $mmTable . '.uid_local AND ' . $mmTable . '.uid_foreign IN (' . implode(',', $catMMList) . ')'; + + if( $mmTable == 'sys_category_record_mm' ){ + $sqlMMCondition = 'AND ' . $mmTable . '.tablenames = "' . $table . '" AND ' . $mmTable . '.fieldname = "' . $catColumn . '" AND ' . $table . '.uid = ' . $mmTable . '.uid_foreign AND ' . $mmTable . '.uid_local IN (' . implode(',', $catMMList) . ')'; + print $sqlMMCondition; + } } $newsSelect = (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type') == 'news') ? ',' . $currentSetup['sqlTitle'] . ',' . $currentSetup['sqlKeywords'] : ''; From 5e777ded608bc0c3fb6e2dce59a13b2bcae58df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sala=C3=BCn?= Date: Wed, 7 Nov 2018 00:01:05 +0100 Subject: [PATCH 2/2] Update class.tx_ddgooglesitemap_dmf.php Forget to remote a debug trace --- class.tx_ddgooglesitemap_dmf.php | 1 - 1 file changed, 1 deletion(-) diff --git a/class.tx_ddgooglesitemap_dmf.php b/class.tx_ddgooglesitemap_dmf.php index 4d8bba7..d932d71 100755 --- a/class.tx_ddgooglesitemap_dmf.php +++ b/class.tx_ddgooglesitemap_dmf.php @@ -97,7 +97,6 @@ protected function generateSitemapContent() { if( $mmTable == 'sys_category_record_mm' ){ $sqlMMCondition = 'AND ' . $mmTable . '.tablenames = "' . $table . '" AND ' . $mmTable . '.fieldname = "' . $catColumn . '" AND ' . $table . '.uid = ' . $mmTable . '.uid_foreign AND ' . $mmTable . '.uid_local IN (' . implode(',', $catMMList) . ')'; - print $sqlMMCondition; } }