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 | 77 | |
| 78 | 78 | // Check if the tagcloud fielset entry exists, if not, create it |
| 79 | 79 | $iFieldsetId = TagCloudPlugin::tagFieldsetExists(); |
| 80 | - if(PEAR::isError($iFieldsetId)){ | |
| 81 | - return false; | |
| 82 | - } | |
| 83 | - if($iFieldsetId !== false){ | |
| 80 | + if($iFieldsetId === false){ | |
| 84 | 81 | $oFieldset = TagCloudPlugin::createFieldset(); |
| 85 | 82 | if (PEAR::isError($oFieldset) || is_null($oFieldset)) { |
| 86 | 83 | return false; |
| ... | ... | @@ -91,10 +88,7 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); |
| 91 | 88 | |
| 92 | 89 | // Check if the tagcloud document field entry exists, if not, create it |
| 93 | 90 | $fExists = TagCloudPlugin::tagFieldExists(); |
| 94 | - if(PEAR::isError($fExists)){ | |
| 95 | - return false; | |
| 96 | - } | |
| 97 | - if($fExists !== false){ | |
| 91 | + if($fExists === false){ | |
| 98 | 92 | $oField = TagCloudPlugin::createDocumentField($iFieldsetId); |
| 99 | 93 | if (PEAR::isError($oField) || is_null($oField)) { |
| 100 | 94 | return false; |
| ... | ... | @@ -160,12 +154,9 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); |
| 160 | 154 | $sTag = DBUtil::getOneResultKey(array($sQuery), 'id'); |
| 161 | 155 | |
| 162 | 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 | 160 | return $sTag; |
| 170 | 161 | }else{ |
| 171 | 162 | return false; |
| ... | ... | @@ -183,12 +174,9 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); |
| 183 | 174 | $iFieldset = DBUtil::getOneResultKey(array($sQuery), 'id'); |
| 184 | 175 | |
| 185 | 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 | 180 | return $iFieldset; |
| 193 | 181 | }else{ |
| 194 | 182 | return false; |
| ... | ... | @@ -198,4 +186,4 @@ require_once(KT_LIB_DIR . '/templating/templating.inc.php'); |
| 198 | 186 | $oPluginRegistry =& KTPluginRegistry::getSingleton(); |
| 199 | 187 | $oPluginRegistry->registerPlugin('TagCloudPlugin', 'ktcore.tagcloud.plugin', __FILE__); |
| 200 | 188 | |
| 201 | 189 | -?> |
| 190 | +?> | |
| 202 | 191 | \ No newline at end of file | ... | ... |