File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/Http/Controllers/Admin Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -372,16 +372,21 @@ protected function getVisualThemes(): array
372372 protected function buildRenderSet (array $ updates , array $ loadedBlocks ): array
373373 {
374374 $ changes = $ updates ['changes ' ] ?? [];
375- $ changedIds = array_merge (
376- $ changes ['added ' ] ?? [],
377- $ changes ['updated ' ] ?? []
378- );
375+ $ addedIds = $ changes ['added ' ] ?? [];
376+ $ updatedIds = $ changes ['updated ' ] ?? [];
377+ $ changedIds = array_merge ($ addedIds , $ updatedIds );
379378
380379 $ renderSet = [];
381380
382381 foreach ($ changedIds as $ id ) {
383382 $ renderSet [] = $ id ;
384383
384+ // If block is in added and has a parent, include parent's children
385+ if (in_array ($ id , $ addedIds ) && isset ($ loadedBlocks [$ id ]['parentId ' ]) && $ loadedBlocks [$ id ]['parentId ' ]) {
386+ $ parentId = $ loadedBlocks [$ id ]['parentId ' ];
387+ $ this ->addChildren ($ parentId , $ loadedBlocks , $ renderSet );
388+ }
389+
385390 // Walk up parent chain
386391 $ currentId = $ id ;
387392 while (isset ($ loadedBlocks [$ currentId ]['parentId ' ]) && $ loadedBlocks [$ currentId ]['parentId ' ]) {
You can’t perform that action at this time.
0 commit comments