There is a one word error in the node.module that prevents seeing the full text version of content posts in preview. The full version heading in preview is only followed by two blank lines.
The issue is described in this discussion. A fix for the problem was posted in this discussion, but it seems never to have been formally submitted, reviewed and committed. It is a very simple fix, and unless it conflicts with something it should probably be corrected in the distributed files.
The module has:
$output .= node_view($node, 1, FALSE, 0);
The published fix is:
$output .= node_view(clone($node), 1, FALSE, 0);
Is there any reason this has not been corrected since 4.6.2 (it is still in the current 4.7CVS and CS0.8.3RC5b)? Other than it was just something that fell through the cracks and was overlooked?
Comment | File | Size | Author |
---|---|---|---|
#6 | node_preview_6.patch | 989 bytes | greggles |
#4 | node_preview_5.patch | 982 bytes | greggles |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedIf there was no issue opened for this, how should we get to know about it? There are too many posts in the forums to read all of them. The fix suggests a problem with php 5. Can anybody who uses php 5 look into it?
Comment #2
thomherfs CreditAttribution: thomherfs commentedThat's why I mentioned it.
As I said, I assumed that it was a little issue that fell through the cracks.
I ran across if while looking for something else in the forums and thought it should be called to someone's attention.
I'm not using PHP5 on the sites I'm working with, so it isn't really something I can deal with. I imagine that there are a lot of little things like this hidden in the forum discussions that were never officially reported since the end-user with the problem thought that posting it in the forum was good enough.
Comment #3
paddy_deburca CreditAttribution: paddy_deburca commentedThere is a drupal_clone() function to implement clone() on those PHP platforms that do not natively have the function.
Paddy.
Comment #4
gregglesI can confirm this using PHP5 and a fresh checkout of HEAD. I'm not sure if it also impacts the PHP4.x users or not (I didn't test that).
I'm unclear about paddys' comment regarding clone and weather I should be using drupal_clone instead of clone. I can confirm that this fix worked for me and didn't seem to break other stuff (note - I didn't do extensive testing).
Comment #5
Tobias Maier CreditAttribution: Tobias Maier commentedhttp://api.drupal.org/api/HEAD/function/drupal_clone
-->replace clone() with drupal_clone()
Comment #6
gregglesTobias - I had seen that API doc and I'll take your brief message to mean that the patch should use drupal_clone, my question is basically why?
Thanks kindly for the review. I have updated the patch.
Comment #7
Tobias Maier CreditAttribution: Tobias Maier commentedhttp://de3.php.net/manual/en/language.oop5.cloning.php
because clone() is only available in php 5+ and not in php4
Comment #8
Tobias Maier CreditAttribution: Tobias Maier commentedif you take a look at drupal_clone() then you can see that it checks if you are using php5 and if this is true then it uses clone() if not the it copies the object
Comment #9
gregglesThanks kindly for the help, Tobias.
Comment #10
chx CreditAttribution: chx commentedyes you should use drupal_clone for this.
Comment #11
chx CreditAttribution: chx commentedi missed _6 sorry. (thanks webchick for pointing out)
Comment #12
simeI recreated the problem in php5. I applied the patch - fixed the problem. I have all the modules installed, so I created various content types and also inserted
into the text to see if I could break anything. All good, I've updated the ticket status.
Comment #13
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedApplied.
Comment #14
(not verified) CreditAttribution: commented