Closed (fixed)
Project:
Contextual links
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2010 at 21:36 UTC
Updated:
16 Nov 2010 at 21:52 UTC
In my install, the node preview gets a configure 'overlay' aswell. The configure link in a node/add/$type form however links to node//edit (notice the empty $nid, because it's a node add form).
I'd like to suggest to make the contextual links for nodes ignore node preview mode. The links will not work, and clicking the link (in node/$nid/edit form) will click away from the node form where you are previewing your node.
Comments
Comment #1
philbar commentedThanks! I'll try to figure out a fix soon. It's because the node hasn't been saved, so the current logic can't figure out the node id because it hasn't been created yet.
Comment #2
teezee commentedThat, AND maybe skip rendering the contextual links in node preview altogether, as clicking the link would guide a user away from the edit form.
You can distinguish normal node rendering from node preview by maybe checking the $node->build_mode.
http://api.drupal.org/api/function/node_preview/6 says:
...
...
Maybe that helps?
Thanks for a nice module, clean and to the point!
Comment #3
philbar commentedComment #4
philbar commentedhttp://drupal.org/cvs?commit=414510
Comment #6
teezee commentedThe node preview check that is currently implemented is too 'destructive' for presenting contextual links. Simply checking for the existence of the function
node_preview()is not safe enough because the check:will allready fail when the file node.pages.inc is included. I would suggest a stricter check like so:
For some reason creating the patch gives me strange results, but it could be done like so (line 55 of current dev build):
I found this problem using Panels for both Node and Node revision pages, in that case node.pages.inc is apparently included, maybe for
node_revision_overview().Comment #7
philbar commentedhttp://drupal.org/cvs?commit=452064