Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full Site Editing: new page WSOD on Simple Sites #34689

Closed
vindl opened this issue Jul 16, 2019 · 8 comments · Fixed by #34640
Closed

Full Site Editing: new page WSOD on Simple Sites #34689

vindl opened this issue Jul 16, 2019 · 8 comments · Fixed by #34640
Assignees
Labels
[Goal] Full Site Editing [Pri] Normal Schedule for the next available opportuinity. [Type] Bug When a feature is broken and / or not performing as intended

Comments

@vindl
Copy link
Member

vindl commented Jul 16, 2019

Trying the recently deployed version of FSE on Simple sites produces WSOD when trying to edit a new page.

Note that you'll need to assign correct taxonomy terms to your CPTs manually. This is expected since we still haven't merged the automated data population functionality on Dotcom, so they would refuse to render otherwise.

screenshot-2019-06-12-at-17 46 11

screenshot-2019-06-12-at-17 46 25

This can be added in Gutenberg's sidebar manually:

Screenshot 2019-07-17 at 00 23 42

After that is set up, the rendering and editing should work correctly for exiting pages.
However, when trying to create a new page I'm running into WSOD with the following error:

Uncaught (in promise) TypeError: Cannot read property 'attributes' of undefined
    at ke (index.js?m=1562960750h&ver=1562960750:2)
    at index.js?m=1562960750h&ver=1562960750:2
    at c (lodash.min.js?m=1540208548h&ver=4.17.11:6)
    at ru (lodash.min.js?m=1540208548h&ver=4.17.11:67)
    at gn (index.js?m=1562960750h&ver=1562960750:2)
    at index.js?m=1562960749h&ver=1562960749:17
    at tryCatch (wp-polyfill.min.js?m=1550600082h&ver=7.0.0:3)
    at Generator.invoke [as _invoke] (wp-polyfill.min.js?m=1550600082h&ver=7.0.0:3)
    at Generator.t.<computed> [as next] (wp-polyfill.min.js?m=1550600082h&ver=7.0.0:3)
    at index.js?m=1562960748h&ver=1562960748:1

I've noted this issue before on self-hosted setup here: #34481 and tracked it down to a PR that seemed to introduce it there, but I couldn't repro it in that environment since.

@vindl vindl added [Type] Bug When a feature is broken and / or not performing as intended [Pri] BLOCKER Requires immediate attention. [Goal] Full Site Editing labels Jul 16, 2019
@vindl
Copy link
Member Author

vindl commented Jul 17, 2019

As @mmtr found out:

I patched that function on my sandbox to return a single line string (<!-- wp:a8c/template {"templateId":1657} /--><!-- wp:a8c/post-content /--><!-- wp:a8c/template {"templateId":1658} /-->) and I don't get the WOSD anymore

So the WSOD is caused by having spaces or new lines in the page template content. This seems to be related to the fact that we are still inserting this content manually on Dotcom, which in the end produces these spaces in get_template_content.

@mmtr mmtr added [Pri] Normal Schedule for the next available opportuinity. and removed [Pri] BLOCKER Requires immediate attention. labels Jul 17, 2019
@mmtr
Copy link
Member

mmtr commented Jul 17, 2019

Decreased the priority since this will be likely solved once we have the automated data population functionality on WP.com.

@vindl
Copy link
Member Author

vindl commented Jul 18, 2019

Decreased the priority since this will be likely solved once we have the automated data population functionality on WP.com.

@mmtr based on my latest testing I'm not sure if this will be the case. I've executed the same data population method on my Dotcom test site to try to replicate the content without spaces (e.g. not manually entered one), and I still get the WSOD when trying to create a new page.

@mmtr
Copy link
Member

mmtr commented Jul 18, 2019

@mmtr based on my latest testing I'm not sure if this will be the case. I've executed the same data population method on my Dotcom test site to try to replicate the content without spaces (e.g. not manually entered one), and I still get the WSOD when trying to create a new page.

Does that mean that you created the data manually from the editor without entering new lines in between? I tried the same and even though the new lines were added automatically (not sure why, maybe wpautop?). Can you debug what A8C_WP_Template::get_template_content is returning on your testing?

If I add the data programmatically (after applying Automattic/themes#1062 to my sandbox), A8C_WP_Template::get_template_content doesn't return any extra line and I don't get the WSOD.

@vindl
Copy link
Member Author

vindl commented Jul 18, 2019

Does that mean that you created the data manually from the editor without entering new lines in between? I tried the same and even though the new lines were added automatically (not sure why, maybe wpautop?). Can you debug what A8C_WP_Template::get_template_content is returning on your testing?

No, I executed the code that FSE provides for that -

on plugin initialization (manually edited the code on my sandbox just for this test run).

@vindl
Copy link
Member Author

vindl commented Jul 18, 2019

Here's the dump of my A8C_WP_Template::get_template_content:

'<!-- wp:a8c/template {"templateId":31,"align":"full"} /-->

<!-- wp:a8c/post-content {"align":"full"} /-->

<!-- wp:a8c/template {"templateId":32,"align":"full"} /-->'

Still seems to be returning newlines - not sure why it populated data differently in this case. 🤔 Maybe some preprocessing (e.g. wpautop) is not happening on theme switch.

@vindl
Copy link
Member Author

vindl commented Jul 18, 2019

I merged the following PRs:

#34640
Automattic/themes#1062

Based on #34689 (comment) I'm going to close this. I'll reopen it if it turn out that automatic data population by themes doesn't resolve it.

@vindl vindl closed this as completed Jul 18, 2019
@vindl vindl self-assigned this Jul 18, 2019
@vindl
Copy link
Member Author

vindl commented Jul 19, 2019

@mmtr I verified that this is now working as expected with new theme approach in D30622-code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Full Site Editing [Pri] Normal Schedule for the next available opportuinity. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants