Skip to content

Commit bdfea49

Browse files
committed
fix: remove inner-block cleanup
1 parent 5afe4f5 commit bdfea49

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

src/Modules/GraphQL/Data/ContentBlocksResolver.php

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,7 @@ final class ContentBlocksResolver {
2121
* @return array<string,mixed>
2222
*/
2323
public static function handle_do_block( array $block ): array {
24-
$block = self::cleanup_inner_content( $block );
25-
26-
return $block;
27-
}
28-
29-
/**
30-
* Cleans up inner content of a block.
31-
*
32-
* This prevents errors when there are more innerContent items than innerBlocks.
33-
*
34-
* @param array<string,mixed> $block The block to clean up.
35-
* @return array<string,mixed> The cleaned up block.
36-
*/
37-
private static function cleanup_inner_content( array $block ): array {
38-
// If either innerBlocks or innerContent is empty, we don't need to do anything.
39-
if ( empty( $block['innerBlocks'] ) || empty( $block['innerContent'] ) ) {
40-
return $block;
41-
}
42-
43-
// If the counts are the same, we don't need to do anything.
44-
if ( count( $block['innerBlocks'] ) === count( $block['innerContent'] ) ) {
45-
return $block;
46-
}
47-
48-
// If innerContent has more items than innerBlocks, we need to remove the extra items.
49-
if ( count( $block['innerBlocks'] ) < count( $block['innerContent'] ) ) {
50-
graphql_debug(
51-
'cleaning ',
52-
[
53-
'block' => $block,
54-
]
55-
);
56-
$block['innerContent'] = array_filter( $block['innerContent'] );
57-
}
58-
24+
// @todo.
5925
return $block;
6026
}
6127
}

0 commit comments

Comments
 (0)