As far as I can tell, the preview does not work when creating new content.

It shows the page, but all fields remain blank, while they populate as content is entered on edit pages.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

iancawthorne created an issue. See original summary.

iancawthorne’s picture

Title: Preview only when editing content, not creating » Preview only works when editing content, not creating
cedricl’s picture

Also noticed this issue after updating form 2.1.3 to 2.1.4. I downgraded for now, but might be a good thing to look at changes made from 2.1.3 to 2.1.4.

iancawthorne’s picture

Yes, I can confirm that is the case for me too. Works on create pages on 2.1.3, but not on 2.1.4.

atul_ghate’s picture

Assigned: Unassigned » atul_ghate

I can also confirmed the same,I will work on this issue.

atul_ghate’s picture

Status: Active » Needs review
StatusFileSize
new10.61 MB

The issue was due to the wrong order of parameters being passed to the samePagePreviewRenderPreview JavaScript function. In version 2.1.3, the code used: $response->addCommand(new InvokeCommand(NULL, 'samePagePreviewRenderPreview', [$entity->uuid()]));

However, in version 2.1.4, an additional NULL parameter was added: $response->addCommand(new InvokeCommand(NULL, 'samePagePreviewRenderPreview', [NULL, $entity->uuid()]));
This caused the JavaScript function to receive NULL for the UUID, resulting in it not working correctly. By correcting the order of the parameters, the issue was resolved. i have aslo confirmed that view mode is working as well.

iancawthorne’s picture

I can confirm the patch at #6 resolves the issue for me.

atul_ghate’s picture

Assigned: atul_ghate » Unassigned
dishakatariya’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new116.17 KB
new167.93 KB

Hi, I have verified this issue with the #6 patch applied successfully on D11 version.

Testing Steps:
1. Goto your local D11 version.
2. Install the module.
3. Go to the admoin/content
4. Add content and check Preview only works when editing content, not creating.

Test Results:
Now the preview works during creating the node as well.

Attached the Before and After Screenshots as well.
Hence moving to RTBC
RTBC+1

cosmicdreams made their first commit to this issue’s fork.

cosmicdreams’s picture

Status: Reviewed & tested by the community » Fixed

Thank you, merged.

atul_ghate’s picture

Hi @cosmicdreams ,

Thanks for merging the MR.

I noticed that I wasn't credited for resolving this issue. Could you let me know if there's something I might have missed?

cosmicdreams’s picture

cosmicdreams’s picture

Issue summary: View changes
StatusFileSize
new15.85 KB

I don't think you did anything wrong. Much of what governs this system is automated. From what I can see you have been credited

atul_ghate’s picture

Yes, now I have been credited. Thank you, @cosmicdreams

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jonloh’s picture

Version: 2.1.4 » 2.1.x-dev
StatusFileSize
new278.5 KB

problem

Looks like it's not working again on Drupal 10.3.6 with new content, as shown in the screencast here.

Only works well when I edit content.

jonloh’s picture

Reverting the code from patch #6 seems to resolve the issue for Drupal 10.3.6.

It looks like we may need to create a separate version specifically for Drupal 10 to ensure compatibility.

yevko’s picture

This change is not being pulled when the last version of the module is installed.

yevko’s picture