Make Preview override work on node add page

Created on 25 February 2023, over 2 years ago
Updated 28 February 2023, over 2 years ago

Problem/Motivation

A follow up to πŸ“Œ Take over the Preview button Fixed

We wish to make this functionality work on brand new nodes. Nodes that haven't been saved before. Basically, the node add page.

Proposed resolution

Figure out how to make the preview work for a node add page.

πŸ“Œ Task
Status

Fixed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cosmicdreams
  • Assigned to brianperry
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Don't have a solution yet, but I think I understand why this is behaving differently from the edit form. If I monitor the tempstore (the key_value_expire table) as I preview from node edit, each preview action overwrites the previous entry for that UUID. If I do the same from the node add form, each preview action gets keyed under a new UUID.

    What isn't clear to me is if this is being caused by a flaw in our logic, or is a side effect of the entity not really existing until the entity is initially created.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    I don't think it's a flaw. The node hasn't been created yet so it hasn't been persisted with a UUID. I could route around for this but I suspect that there is logic that checks for the existence of a UUID and if one isn't found it generates a new one.

    Maybe we could check the tempstore for the last inserted item

  • @brianperry opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    I was able to fix this by making the ajax callback a little more dynamic.

  • Status changed to Fixed over 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    Looks good. Didn't manually test but good progress.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul
Production build 0.71.5 2024