Blockparser can crash with bad node data

Created on 28 August 2024, 5 months ago

Problem/Motivation

Don't ask me why, but somehow I had this site that ended up with one of the gutenberg tags having bad JSON in their attributes. This makes the site crash when you save a node. Which is kind of unnecessary. So regardless of whether that bad data is there or not, we should still make it possible to at least save things, and not crash.

Looking at it more, the wordpress block parser class seems to have the exact same issue, so I will try to report and fix the bug there as well.

Steps to reproduce

See attached tests

Proposed resolution

Ensure we are creating objects with the expected parameter types when they come from user input being parsed into data structures

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇳🇴Norway eiriksm Norway

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @eiriksm
  • Merge request !192Add a test → (Open) created by eiriksm
  • Pipeline finished with Failed
    5 months ago
    Total: 238s
    #267034
  • Pipeline finished with Success
    5 months ago
    Total: 277s
    #267040
  • Status changed to Needs review 5 months ago
  • 🇳🇴Norway eiriksm Norway

    Here is a link to a failing test, for convenience. The MR now passes its own tests

    https://git.drupalcode.org/project/gutenberg/-/jobs/2576661

    now to try to figure out if I can contribute the fix to wordpress

  • Pipeline finished with Failed
    4 months ago
    Total: 384s
    #276125
  • Pipeline finished with Failed
    4 months ago
    Total: 421s
    #276180
  • Pipeline finished with Success
    4 months ago
    #276186
  • Pipeline finished with Failed
    4 months ago
    Total: 463s
    #277997
  • Pipeline finished with Failed
    4 months ago
    Total: 362s
    #278329
  • Pipeline finished with Failed
    4 months ago
    Total: 350s
    #278518
  • Pipeline finished with Canceled
    4 months ago
    Total: 84s
    #278533
  • Pipeline finished with Success
    4 months ago
    #278535
  • Pipeline finished with Success
    3 months ago
    Total: 204s
    #323251
  • Pipeline finished with Failed
    3 months ago
    #323290
  • Pipeline finished with Failed
    3 months ago
    #323332
  • Pipeline finished with Success
    3 months ago
    Total: 154s
    #323333
  • Pipeline finished with Success
    3 months ago
    Total: 163s
    #323336
  • Pipeline finished with Success
    3 months ago
    Total: 151s
    #323480
  • Pipeline finished with Failed
    3 months ago
    #323485
  • Pipeline finished with Success
    3 months ago
    Total: 122s
    #323486
  • Pipeline finished with Canceled
    3 months ago
    Total: 85s
    #323488
  • Pipeline finished with Success
    3 months ago
    Total: 169s
    #323490
  • Pipeline finished with Success
    3 months ago
    Total: 142s
    #323879
  • Pipeline finished with Success
    3 months ago
    Total: 141s
    #323888
  • Pipeline finished with Success
    3 months ago
    Total: 176s
    #323925
  • Pipeline finished with Failed
    about 1 month ago
    Total: 195s
    #368066
  • Pipeline finished with Success
    about 1 month ago
    Total: 208s
    #368493
  • Pipeline finished with Success
    about 1 month ago
    #368500
Production build 0.71.5 2024