wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)

Home Page:https://wagtail.github.io/react-streamfield/public/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Block id changes for every page save for block in stream field

dniegel opened this issue · comments

Hi,
i noticed this behavior:
Every block inside a stream field on a page is saved with a new id when the page is saved (with or without changes on the page or in the blocks). This also seems to happen when copying a page.
"Regular" wagtail functionality (Wagtail 2.3 and 2.4) leaves a block id untouched after it was created in the same case.

I'm yet unsure if this functionality change might be on purpose or if it might be a bug? Found this while trying to compare block contents via block id after a page was copied.

Versions:
Wagtail 2.3 + wagtail-react-streamfield 0.9.0
Wagtail 2.3 + wagtail-react-streamfield 1.1.1
Wagtail 2.4 + wagtail-react-streamfield 1.1.1

Steps to reproduce:

  1. Create a page with a StreamField and a CharBlock inside like
class TestPage(Page):
    body = StreamField([
        ('text', blocks.CharBlock()),
    ], null=True, blank=True)

    content_panels = Page.content_panels + [
        StreamFieldPanel('body'),
    ]
  1. Create one "text" block and save the page

  2. Save the page again

  3. Compare the content_json for the page revisions created in 2) and 3) - the block ids of "text" should differ

I have the same issue. Would be great if this could be fixed.

Fixed by wagtail/wagtail@ce56043. Will be released in a new wagtail-react-streamfield version today.

Hi @BertrandBordage,

Thanks for the fix. When can we expect a release with this fix?

Thanks for your efforts!

Felix

@felixschul we had a small change of plan, a talented front-end developer is now contributing to react-streamfield (wagtail-deprecated/react-streamfield#6) to fix the last code quality issues found by Thibaud Colas. I was waiting for his review to do a final high quality react-streamfield 1.0 release. He almost finished his contribution, so I will include his work and release react-streamfield 1.0 and a new version of wagtail-react-streamfield normally this week-end :)

@BertrandBordage Great to hear, thanks for the update! I am looking forward to the release. Thanks for the good work and your efforts, they are appreciated! :)

Released in version 1.2.0.