When adding a node, the title is initially blank, so there can be no related content. When editing an existing node, however, there may already be existing content. Currently the module waits for the user to type before triggering the ajax. Instead, the page should come pre-loaded with the related content (and expanded if necessary), or perhaps the jQuery could initiate a lookup (an extra http transaction, but perhaps simpler).

I might argue that this constitutes a bug, because the display of related content is wrong before the user types. I left it as a feature request, however.

This issue completes my to-do list for uniqueness (I hope!). Thanks for all your nearly-instantaneous commits at even in the wee hours the night. ;)

Comments

danchadwick’s picture

Status: Active » Needs review
StatusFileSize
new4.58 KB

Implementing this has the side-effect of eliminating the special case for preview submit handler, allowing the deletion of _uniqueness_node_add_submit (which has/had a bug in it anyway (not setting the nid in $store)).

This does raise the question about why the jQuery removes clears the widget upon preview. Why is this desirable? I think we should also eliminate passing the preview setting to the jQuery, and the jQuery code that uses this flag to initially clear the contents. Perhaps there is a use case I don't understand. I'll leave this for a separate issue.

This patch is in the area of earlier patches. If the patches aren't committed in chronological order or if minor edits were made, this patch may not apply.

bforchhammer’s picture

Status: Needs review » Fixed

Committed with slight changes.

I'm not sure about the uniqueness.clean() statement either; I've commented it out to make node previews work again, and created a follow up issue: #1897880: Cleanup logic for node previews.

Status: Fixed » Closed (fixed)

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