Skip to content

fix: builder layout meta stays raw, never modelled as content (too_large on deep Elementor trees) - #40

Merged
ABB65 merged 1 commit into
mainfrom
fix/builder-meta-not-modelled
Sep 27, 2026
Merged

ABB65 merged 1 commit into
mainfrom
fix/builder-meta-not-modelled

Conversation

@ABB65

@ABB65 ABB65 commented Sep 27, 2026

Copy link
Copy Markdown
Member

Problem

On the Elementor golden, the migration export failed as a whole: EXPORT_FAILED too_large with "Content nesting exceeds the supported modelling depth". Deep _elementor_data trees on the landing and about pages were modelled into meta_* content fields and wp-structured-values rows, and one of them went past the modelling depth.

Change

  • Page-builder meta (Policy::BUILDER: _elementor_*, _et_pb_*) is no longer modelled as content. It is kept only in the raw evidence (raw-posts / RawIR), where Migrate reads it. This matches @contentrain/wp-import, which never turns underscore meta into content fields, so status and entry parity do not change.
  • Past the modelling depth, value() stops throwing. It keeps the rest of the subtree as JSON text and records a nesting-too-deep: kept as JSON text warning. A single deep value can no longer fail the export.

Verification

  • tests/builder.php: 64 lines of new checks.
  • The full acceptance suite passes on an isolated Docker stack, including parity with wp-import 0.5.7.
  • Elementor golden, with this build installed:
    • The export completes: 8 models, 13 entries, 53 files.
    • It has no nesting warnings and no issues.
    • _elementor_data is kept in rawir.json.
    • wp-page has no meta_elementor_* fields.
  • ACF golden: the export completes, with 15 models and 20 entries.

Open points (separate work)

  • The comment on Policy::BUILDER still mentions CORE_META. wp-import actually skips every _ key.
  • Bridge still models other underscore meta (_yoast_*, _aioseo_*). This is a separate parity gap with wp-import.
  • The release and the WordPress.org plugin update are out of scope for this PR and need the founder's approval.

…rge on deep Elementor trees)

Page-builder meta (Policy::BUILDER: _elementor_*, _et_pb_*) was modelled into
meta_* fields and wp-structured-values rows; a deeply nested _elementor_data
tree exceeded the modelling depth and failed the whole export (too_large).
It now travels only in raw-posts / RawIR, matching @contentrain/wp-import,
which never turns underscore meta into content fields.

Past the modelling depth, value() keeps the remaining subtree as JSON text and
records a nesting-too-deep warning instead of throwing.
@ABB65

ABB65 commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

ONAY bcc8766 (t9)

No silent loss:

  • Builder meta that is skipped (only the 10 exact keys in Policy::BUILDER) isn't lost. raw-posts gets the whole $p (models.php:271), so the keys stay in RawIR.
  • The test checks it end to end: the 12-container tree's leaf Golden deep can be read from raw-posts, and _et_pb_use_builder stays in raw-posts too.
  • Past the depth limit, the subtree is kept as JSON text and exactly 1 nesting-too-deep warning is written. The gap is visible, not silent.

Backward compatibility: migrate (main) reads _elementor_data only from raw/RawIR (facts behaviors.ts/builder.ts). No meta_elementor_*/meta_et_pb_* content field is consumed in migrate or studio (git grep: 0). The REST envelope doesn't change; only these fields drop out of the content model.

PHP/WP: the plugin needs PHP 7.4 / WP 6.2. php:7.4-cli php -l on the plugin + includes + tests/builder.php: 0 errors. The new code uses no API newer than 7.4 (preg_match, wp_json_encode, ??).

Local gates (Docker, isolated stack, torn down afterwards):

  • tests/run.sh acceptance: exit 0, 378 PASS. The FAIL matches in the log are only test names ("fails validation") and wp-cli cache warnings.
  • tests/builder.sh: 26/26 PASS, exit 0.
  • tests/check-plugin.sh (Plugin Check 2.1.0): 0 errors, 14 warnings, all from files that already use $wpdb (DirectQuery/NoCaching, the ones documented in RELEASING.md). The file changed in this PR produces none.
  • npm test 2/2 · test:secrets 85 files, 0 secrets · test:reader ok.
  • CI: PHP 7.4/8.3 syntax, metadata, small/large, acceptance all ✓. merge-tree with main is clean.

Non-blocking notes:

  1. tests/builder.php prints "Builder checks: 0" (the global $checks counter doesn't survive the eval-file scope). Old behaviour, cosmetic; the PASS lines are correct.
  2. If a user lists one of the BUILDER keys in selected_meta, it now produces no content field and no warning (it's still in raw). An edge case; a "builder meta stays raw" warning could be added.
  3. wp_json_encode returning false would give ''. The warning is still written, so it's not silent.

@ABB65
ABB65 merged commit 16e798d into main Sep 27, 2026
9 checks passed
@ABB65
ABB65 deleted the fix/builder-meta-not-modelled branch September 27, 2026 08:44
@ABB65 ABB65 mentioned this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant