Skip to content

Commit

Permalink
BUGFIX: Load full nodes for content tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Jul 23, 2021
1 parent 6d9ef07 commit cfa67d1
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions packages/neos-ui-sagas/src/UI/ContentTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export function * watchRequestChildrenForContextPath({globalRegistry}) {
// TODO: Call yield put(actions.UI.ContentTree.requestChildren(contextPath));
const nodeTypesRegistry = globalRegistry.get('@neos-project/neos-ui-contentrepository');
const {contextPath, opts} = action.payload;
const {activate} = opts;
const {q} = backend.get();
let parentNodes;
let childNodes;
Expand All @@ -99,7 +98,7 @@ export function * watchRequestChildrenForContextPath({globalRegistry}) {
parentNodes = yield query.getForTree();

const nodeTypeFilter = `${nodeTypesRegistry.getRole('contentCollection')},${nodeTypesRegistry.getRole('content')}`;
childNodes = yield query.neosUiFilteredChildren(nodeTypeFilter).getForTree();
childNodes = yield query.neosUiFilteredChildren(nodeTypeFilter).get();
} catch (err) {
yield put(actions.UI.ContentTree.invalidate(contextPath));
yield put(actions.UI.FlashMessages.add('loadChildNodesError', err.message, 'error'));
Expand All @@ -112,20 +111,7 @@ export function * watchRequestChildrenForContextPath({globalRegistry}) {
nodeMap[$get('contextPath', node)] = node;
return nodeMap;
}, {});

// The nodes loaded from the server for the tree representation are NOT the full
// nodes with all properties; but merely contain as little properties as needed
// for the tree.
// In order to not OVERRIDE the properties we already know, we need to merge
// the data which the nodes already in the system; and not override them completely.
yield put(actions.CR.Nodes.merge(nodes));

//
// ToDo: Set the ContentCanvas src / contextPath
//
if (activate) {
yield put(actions.UI.ContentTree.focus(contextPath));
}
}
});
}

0 comments on commit cfa67d1

Please sign in to comment.