2008-04-22 Oliver Hader <oliver@typo3.org>
* Fixed bug #8182: Fatal error on calling sysLog() of lock object if locking method is unknown
+ * Fixed bug #8148: IRRE - Expanded or collapsed state of new child records is not handled correctly
2008-04-22 Dmitry Dulepov <dmitry@typo3.org>
* Update expanded/collapsed states on new inline records if any.
*
* @param array $uc: The uc array to be processed and saved (by reference)
- * @param object $tce: Instance of TCEmain that saved data before (by reference)
+ * @param t3lib_TCEmain $tce: Instance of TCEmain that saved data before (by reference)
* @return void
*/
function updateInlineView(&$uc, &$tce) {
foreach ($topRecords as $topUid => $childElements) {
foreach ($childElements as $childTable => $childRecords) {
$uids = array_keys($tce->substNEWwithIDs_table, $childTable);
- $inlineViewCurrent =& $inlineView[$topTable][$topUid][$childTable];
if (count($uids)) {
+ $newExpandedChildren = array();
foreach ($childRecords as $childUid => $state) {
if ($state && in_array($childUid, $uids)) {
$newChildUid = $tce->substNEWwithIDs[$childUid];
- $inlineViewCurrent[] = $newChildUid;
+ $newExpandedChildren[] = $newChildUid;
+ }
+ }
+ // Add new expanded child records to UC (if any):
+ if (count($newExpandedChildren)) {
+ $inlineViewCurrent =& $inlineView[$topTable][$topUid][$childTable];
+ if (is_array($inlineViewCurrent)) {
+ $inlineViewCurrent = array_unique(array_merge($inlineViewCurrent, $newExpandedChildren));
+ } else {
+ $inlineViewCurrent = $newExpandedChildren;
}
}
- $inlineViewCurrent = array_unique($inlineViewCurrent);
}
}
}
},
updateExpandedCollapsedStateLocally: function(objectId, value) {
- var ucName = 'uc'+this.parseFormElementName('parts', objectId, 3, 2);
+ var ucName = 'uc[inlineView]'+this.parseFormElementName('parts', objectId, 3, 2);
var ucFormObj = document.getElementsByName(ucName);
- if (ucFormObj.length) ucFormObj[0].value = value;
+ if (ucFormObj.length) {
+ ucFormObj[0].value = value;
+ }
},
createNewRecord: function(objectId, recordUid) {