Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
nodeblock.module.block_view.patch | 1.11 KB | sherakama |
Comments
Comment #1
tom_o_t CreditAttribution: tom_o_t commentedThanks for this.
What is the line following line for?
Comment #2
sherakama CreditAttribution: sherakama commentedAll 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.
Comment #3
tom_o_t CreditAttribution: tom_o_t commentedGreat - 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!
Comment #4
sherakama CreditAttribution: sherakama commentedYour welcome,
Glad to help.
Comment #5
kybermanThis patch works for me, thank you for saving my time :-)
Comment #6
mortendk CreditAttribution: mortendk commentedsweet - 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
Comment #7
jennypanighetti CreditAttribution: jennypanighetti commentedAnyone 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...
Comment #8
hefox CreditAttribution: hefox commentedOne 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:
/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!
Comment #9
ngmaloney CreditAttribution: ngmaloney commentedPatch 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.
Comment #10
michaellander CreditAttribution: michaellander commentedI 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.