The node_view call in nodeblock_block_view() has changed in D7. I have attached a patch that fixes the toggle and display of Full vs Teaser. Please take a look.

CommentFileSizeAuthor
nodeblock.module.block_view.patch1.11 KBsherakama
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tom_o_t’s picture

Thanks for this.

What is the line following line for?

$lang = "und";
sherakama’s picture

All nodes now have a language applied to them. If you do not specify one then "und" or undefined is the default language that is displayed when rendered. It is then changed later down if a translation is available.

tom_o_t’s picture

Great - thanks - I'll read up some more on language in D7 and try to test this patch properly in the next few days.

Thanks again for the patch, it's great to know that someone else is testing!

sherakama’s picture

Your welcome,

Glad to help.

kyberman’s picture

This patch works for me, thank you for saving my time :-)

mortendk’s picture

sweet - after tearing hair out for an hour i finnally figured out why it wasnt showing anything else than the title .

hopes this patch is added soon

jennypanighetti’s picture

Anyone know why this issue sometimes appears and sometimes doesn't? The first D7 site I made, nodeblock worked fine. The second, I was seeing absolutely nothing and needed this patch (which works great for me BTW).

Nevermind...

hefox’s picture

One potential bug and two best practices issues.

Bug: In order to keep the show/don't show link setting, looks like looks like links need to be removed later somehow as no longer a param for node_view.

Edit: something like this:

$build = node_view( ...);

unset($build['links']);
OR
$build['links']['#access'] = FALSE;

... = $build; 

/End Edit

Other: use LANGUAGE_NONE instead of "und" (http://api.drupal.org/api/drupal/includes--bootstrap.inc/constant/LANGUA...) and remove the previous line instead of commenting it out.

Edit 2: My guess is language stuff isn't needed as node_view autofills with $GLOBALS['language_content']->language if not set.

Edit 3: $build['links'] not $build['#node']->links;

edit 4: fixing typo, rofl. The link was correct at least!

ngmaloney’s picture

Status: Needs review » Needs work

Patch works great. Any idea on when this patch can get rolled in. I would be happy to assist.

Quick correction on comment #8, the constant for setting no language is LANGUAGE_NONE, not LANGUAGE_NODE.

michaellander’s picture

Status: Needs work » Closed (fixed)

I made the changes based on this patch and the comments in this thread, however I had to alter them slightly because of a rather large view modes patch I added. The changes are committed and should appear on the project page shortly. Thank you all for your help and let me know if any further problems arise or if I missed anything.