thanks to http://drupal.org/node/100775, node_form_add_preview() is completely destroying any existing #prefix values on node forms when you preview. :(
attached patch is the smallest/cleanest solution i could come up with that:
a) works
b) should be safe for php5 folks
c) keeps all the node form stuff "close" to itself (i.e. the node preview comes first, then the form's existing #prefix (if any) then the node form itself...).
normally, i wouldn't call this critical, but chx made me do it. ;)
cheers,
-derek
p.s. i'm told #100775 was backported to 4.7.x, so this needs to be, too.
Comments
Comment #1
chx commentedLet me tell you what I feel in PHP.
Comment #2
ChrisKennedy commentedLooks good to me too. chx_s_bane(6) == 'menu'? 'menu' : 'previewing checkboxes';
Comment #3
dries commentedCan we improve the code comments a bit? I.e. explain why we do it this way?
Comment #4
dwwhow's this?
Comment #5
dries commentedWhy does the preview use prefix to begin with? I guess that is a bit of a hack?
The extra documentation is great, but it lacks a bit of a 'why' (background information). It would be great to explain in the code comments how the preview works, and why it piggybacks on the prefix stuff. Thanks dww.
I think the code is acceptable. Let's just use this opportunity to document it properly, and to make it accessible to non FAPI wizards. :)
Comment #6
heine commentedNot sure if this is sufficient, but its quite a novel already.
Comment #7
dwwDries: for why, you must read http://drupal.org/node/100775 (or heine's latest version of the comment). i'm all for self-documenting code and better comments. ;) my natural tendency is to comment a lot, and i know it's a fine line w/ core to avoid "bloat" by putting in too much (e.g. "don't refer to issue nids, that's what cvs log is for..."). but, thanks for asking the right questions and being persistent...
Heine: thanks, that's lovely (IMHO).
Comment #8
dries commentedCommitted to CVS HEAD. Thanks for the great docs, folks.
Comment #9
dwwyay, thanks! updated the copy on s.d.o so i didn't have to have a locally patched version there... ;)
Comment #10
dwwhere's a patch for DRUPAL-4-7
Comment #11
killes@www.drop.org commentedapplied
Comment #12
(not verified) commented