Commit ec8d6ece7fc46efa1b7df4d1b03f6debfbdba562
1 parent
76a09d80
KTS-3608
"After upgrade from 337OSS>346OSS and 31bOSS>346OSS to 353 OSS only the tags for the doc added after the 353 upgrade is listed in the Tag Cloud dashlet." Fixed. Multiple fieldsets were being created. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@9144 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
19 deletions
plugins/tagcloud/TagCloudPlugin.php
| @@ -77,10 +77,7 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | @@ -77,10 +77,7 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 77 | 77 | ||
| 78 | // Check if the tagcloud fielset entry exists, if not, create it | 78 | // Check if the tagcloud fielset entry exists, if not, create it |
| 79 | $iFieldsetId = TagCloudPlugin::tagFieldsetExists(); | 79 | $iFieldsetId = TagCloudPlugin::tagFieldsetExists(); |
| 80 | - if(PEAR::isError($iFieldsetId)){ | ||
| 81 | - return false; | ||
| 82 | - } | ||
| 83 | - if($iFieldsetId !== false){ | 80 | + if($iFieldsetId === false){ |
| 84 | $oFieldset = TagCloudPlugin::createFieldset(); | 81 | $oFieldset = TagCloudPlugin::createFieldset(); |
| 85 | if (PEAR::isError($oFieldset) || is_null($oFieldset)) { | 82 | if (PEAR::isError($oFieldset) || is_null($oFieldset)) { |
| 86 | return false; | 83 | return false; |
| @@ -91,10 +88,7 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | @@ -91,10 +88,7 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 91 | 88 | ||
| 92 | // Check if the tagcloud document field entry exists, if not, create it | 89 | // Check if the tagcloud document field entry exists, if not, create it |
| 93 | $fExists = TagCloudPlugin::tagFieldExists(); | 90 | $fExists = TagCloudPlugin::tagFieldExists(); |
| 94 | - if(PEAR::isError($fExists)){ | ||
| 95 | - return false; | ||
| 96 | - } | ||
| 97 | - if($fExists !== false){ | 91 | + if($fExists === false){ |
| 98 | $oField = TagCloudPlugin::createDocumentField($iFieldsetId); | 92 | $oField = TagCloudPlugin::createDocumentField($iFieldsetId); |
| 99 | if (PEAR::isError($oField) || is_null($oField)) { | 93 | if (PEAR::isError($oField) || is_null($oField)) { |
| 100 | return false; | 94 | return false; |
| @@ -160,12 +154,9 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | @@ -160,12 +154,9 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 160 | $sTag = DBUtil::getOneResultKey(array($sQuery), 'id'); | 154 | $sTag = DBUtil::getOneResultKey(array($sQuery), 'id'); |
| 161 | 155 | ||
| 162 | if (PEAR::isError($sTag)) { | 156 | if (PEAR::isError($sTag)) { |
| 163 | - global $default; | ||
| 164 | - $default->log->error('Error resolving Tag Cloud field: '. $sTag->getMessage()); | ||
| 165 | - return $sTag; | ||
| 166 | - | 157 | + return false; |
| 167 | } | 158 | } |
| 168 | - if(!is_null($sTag)){ | 159 | + if(!is_numeric($sTag)){ |
| 169 | return $sTag; | 160 | return $sTag; |
| 170 | }else{ | 161 | }else{ |
| 171 | return false; | 162 | return false; |
| @@ -183,12 +174,9 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | @@ -183,12 +174,9 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 183 | $iFieldset = DBUtil::getOneResultKey(array($sQuery), 'id'); | 174 | $iFieldset = DBUtil::getOneResultKey(array($sQuery), 'id'); |
| 184 | 175 | ||
| 185 | if (PEAR::isError($iFieldset)) { | 176 | if (PEAR::isError($iFieldset)) { |
| 186 | - global $default; | ||
| 187 | - $default->log->error('Error resolving Tag Cloud fieldset: '. $iFieldset->getMessage()); | ||
| 188 | - return $iFieldset; | ||
| 189 | - | 177 | + return false; |
| 190 | } | 178 | } |
| 191 | - if(!is_null($iFieldset)){ | 179 | + if(!is_numeric($iFieldset)){ |
| 192 | return $iFieldset; | 180 | return $iFieldset; |
| 193 | }else{ | 181 | }else{ |
| 194 | return false; | 182 | return false; |
| @@ -198,4 +186,4 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | @@ -198,4 +186,4 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 198 | $oPluginRegistry =& KTPluginRegistry::getSingleton(); | 186 | $oPluginRegistry =& KTPluginRegistry::getSingleton(); |
| 199 | $oPluginRegistry->registerPlugin('TagCloudPlugin', 'ktcore.tagcloud.plugin', __FILE__); | 187 | $oPluginRegistry->registerPlugin('TagCloudPlugin', 'ktcore.tagcloud.plugin', __FILE__); |
| 200 | 188 | ||
| 201 | -?> | 189 | -?> |
| 190 | +?> | ||
| 202 | \ No newline at end of file | 191 | \ No newline at end of file |