Commit dec9ff24a39f0ef4ca5218134bb2db3bc9698c04
1 parent
c387c4b4
Merged in from STABLE trunk...
KTS-3660 "Clicking on Document fieldsets causes KT to hang" Fixed. The while loop would become infinite if the string was longer than 50 chars and had no spaces. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3a-Release-Branch@9247 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
9 additions
and
1 deletions
plugins/ktcore/admin/documentFieldsv2.php
| ... | ... | @@ -223,21 +223,26 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | function getTypesForFieldset($oFieldset) { |
| 226 | + global $default; | |
| 226 | 227 | if ($oFieldset->getIsGeneric()) { |
| 227 | 228 | return _kt('All types use this generic fieldset.'); |
| 228 | 229 | } |
| 229 | 230 | |
| 230 | 231 | $types = $oFieldset->getAssociatedTypes(); |
| 231 | 232 | if (PEAR::isError($types)) { |
| 233 | + $default->log->debug('Fieldsets admin: Error retrieving list of associated document types.'); | |
| 232 | 234 | return _kt('Error retrieving list of types.'); |
| 233 | 235 | } |
| 234 | 236 | if (empty($types)) { |
| 235 | 237 | return _kt('None'); |
| 236 | 238 | } |
| 239 | + | |
| 237 | 240 | $aNames = array(); |
| 238 | 241 | foreach ($types as $oType) { |
| 239 | 242 | if (!PEAR::isError($oType)) { |
| 240 | 243 | $aNames[] = $oType->getName(); |
| 244 | + }else{ | |
| 245 | + $default->log->debug('Fieldsets admin: Document type gives error: '.$oType->getMessage()); | |
| 241 | 246 | } |
| 242 | 247 | } |
| 243 | 248 | |
| ... | ... | @@ -247,9 +252,12 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { |
| 247 | 252 | if($length < 50){ |
| 248 | 253 | return $list; |
| 249 | 254 | } |
| 255 | + $default->log->debug('Fieldsets admin: wrapping the list of doc types from length '.$length); | |
| 250 | 256 | |
| 257 | + // Wrap the list to 50 characters per line | |
| 251 | 258 | $wrapList = ''; |
| 252 | - while ($length > 50){ | |
| 259 | + $cut = 0; | |
| 260 | + while ($length > 50 && $cut !== false){ | |
| 253 | 261 | $cut = strpos($list, ' ', 50); |
| 254 | 262 | $wrapList .= mb_strcut($list, 0, $cut); |
| 255 | 263 | $wrapList .= '<br />'; | ... | ... |