Skip to content
New issue

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

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

Already on GitHub? # to your account

Root level section entry doesn't supply correct pathname for headless live preview. #4377

Closed
dictions opened this issue Jun 6, 2019 · 2 comments

Comments

@dictions
Copy link

dictions commented Jun 6, 2019

Description

The live preview uses a different URI for root level sections (homepage with empty section URI).

Steps to reproduce

  1. Create a single section with an empty URI, Title Home, handle home
  2. Leave URI as blank, and add a template path.
  3. Live preview, the requested URL is /__home__. Rendering out {{ craft.request.path }} also outputs __home__.

Additional info

  • Craft version: ^3.2.0-beta.1
  • PHP version: 7.0.31
  • Database driver & version: MySQL 5.7.23
  • Plugins & versions:

Screenshot 2019-06-06 13 33 28

@dictions
Copy link
Author

dictions commented Jun 6, 2019

Also related, it appears {{ craft.app.request.isLivePreview }} always returns an empty string now.

brandonkelly added a commit that referenced this issue Jun 7, 2019
@brandonkelly
Copy link
Member

This is fixed for the next release, thanks for reporting!

It’s expected that craft.app.request.isLivePreview would return false when previewing entries in Craft 3.2. Generally when templates need to check that, it’s because they need to do something hacky to work around Live Preview bugs (e.g. #1787 and #2801), and those workarounds are no longer necessary in Craft 3.2, and those hacks would actually start breaking if isLivePreview continued to return true.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants