Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

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

Closed
dniegel opened this issue Feb 6, 2019 · 6 comments
Closed

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

dniegel opened this issue Feb 6, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@dniegel
Copy link

dniegel commented Feb 6, 2019

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

@ChristophTr
Copy link

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

@BertrandBordage BertrandBordage added the bug Something isn't working label Feb 19, 2019
@BertrandBordage
Copy link
Contributor

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

@felixschul
Copy link

Hi @BertrandBordage,

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

Thanks for your efforts!

Felix

@BertrandBordage
Copy link
Contributor

@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 :)

@felixschul
Copy link

@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! :)

@BertrandBordage
Copy link
Contributor

Released in version 1.2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants