fecgov / fec-cms

The content management system (CMS) for the new Federal Election Commission website.
https://www.fec.gov
Other
96 stars 39 forks source link

Error when publishing certain pages made with collection_page template #2372

Closed johnnyporkchops closed 6 years ago

johnnyporkchops commented 6 years ago

Some collecton_pages are getting an error when trying to publish or preview in Wagtail. In production, it gets a 404, locally it gets this error:

Similar issue #2389

raise EntityException('Expected {0}, got {1}'.format(expected_entity, command.data))
draftjs_exporter.entity_state.EntityException: Expected 2, got 1

This is different than the other errors we have with draftail Rich Text Editor (RTE) that will not allow the page to be edited. This allows the page to open in the editor, but does not allow publishing/preview. However it still may have to do with invalid html in the RTE.

This example and several other collection_pages in the H4CC section of Wagtail get this error: https://fec-dev-proxy.app.cloud.gov/admin/pages/8132/edit/

Preview error screenshot:

screen shot 2018-10-25 at 2 20 59 pm

Publish error screenshot:

screen shot 2018-10-25 at 2 20 08 pm

This page has an issue with the reporting example page block. Rather than trying to figure out where it's breaking within the draftJS exporter, we can actually fix this faster by:

johnnyporkchops commented 6 years ago

This issue does not effect creating new pages using the collection_page template.

patphongs commented 6 years ago

@dorothyyeager and I spoke about this today and she knows how to fix this in Wagtail using the above defined method. cc @llienfec