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

[3.2.1] On New Entries, Previews don't show actual preview #4554

Closed
narration-sd opened this issue Jul 12, 2019 · 3 comments
Closed

[3.2.1] On New Entries, Previews don't show actual preview #4554

narration-sd opened this issue Jul 12, 2019 · 3 comments

Comments

@narration-sd
Copy link
Contributor

narration-sd commented Jul 12, 2019

Description

This seems to be a new thing with 3.2.1. It's likely at least side-by-side related to CraftQL invisibility etc. problems detailed overnight in email, to do with changes in preview architecture.

Steps to reproduce

  1. Have a Section set up for normal Twig template view
  2. Try editing and previewing an entry already present -- works; though may double update sometimes/the first time.
  3. Now create a New entry on this section
  4. Click Preview
  5. Note that while the new entry is entirely empty, you see a previous entry presented in the preview. Perhaps the one you just viewed, but might just be due to db ordering
  6. Typing in fields of the New entry updates the preview, but it still shows the old entry, not anything you typed or otherwise from the new.

Additional info

PHP version 7.1.28
OS version Linux 4.15.0-47-generic
Database driver & version MySQL 5.7.25
Image driver & version GD 7.1.28
Craft edition & version Craft Pro 3.2.1
Yii version 2.0.21
Twig version 2.11.3
Guzzle version 6.3.3
Imagine version 0.7-dev
CraftQL 1.3.2
Element API 2.5.4
Redactor 2.3.3.2
@narration-sd
Copy link
Contributor Author

narration-sd commented Jul 12, 2019

additional info: chasing down why the New'd entry doesn't show in other query methods (see email, updated), it appears to be because there's a draftId, but no draft to match it. So perhaps the hiding is due to validation failing.

However, removing the draftId from the New'd Entry's element in the database, while allowing query, doesn't fix this current issue; in fact it just causes Garnish to error, so that there's no update from edit inputs to the preview panel at all.

Given these points, and that it doesn't pop out for me from skimming the 3.2.1 release code changelist that you actually intended not to use Drafts for unsaved New entries, maybe this missing draft is an unintended side effect?

And then cause for this issue and the emailed further unexpected problems?

@brandonkelly
Copy link
Member

When you first create a new entry, it starts out as an “unsaved draft”. So it is in fact a real draft; the part that is missing is that the draft doesn’t have a corresponding source entry yet. Once you click “Save entry” for the first time, the draft will lose its draftId value, and become a normal entry.

Unsaved drafts do in fact support previewing, at least using the core implementation.

@narration-sd
Copy link
Contributor Author

Ok, I just checked this out rather thoroughly, and agree with your view -- fresh new'd entries are now previewing in normal release way. Thanks much for confirming.

The problem leading to this issue post was a matter of hasty twig template re-use, quite remedied.

On the other aspect, lots of hours in, and I have better understanding, will get back to you on this. Part of the (cross-issues) insight problem is that though preview elements do exist, they have two kinds of general invisibility. The second and it turns out less or really non-important is that they aren't apparent in the database yet. But I'll discuss offline. Your reply here does cut yet more out of the branching.

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

No branches or pull requests

2 participants