Extra entry in the $node object

joachim - June 20, 2008 - 20:20
Project:Link
Version:5.x-2.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

A dsm($node) shows these elements that appear to come from this module:

[field_link] => Array
        (
            [0] => Array
                (
                    [url] => www.example.com
                    [title] =>
                    [attributes] => N;
                    [view] => <a href="www.example.com">Website</a>
                )

        )

    [0] => Array
        (
            [url] => www.example.com
            [title] =>
            [attributes] =>
        )

What's the [0] entry? It doesn't look like it belongs there to me. Surely the $node object shouldn't have elements without proper names.

#1

quicksketch - June 29, 2008 - 21:56
Status:active» fixed

Thanks, I'd seen this several times before but I couldn't figure out where it originated. Guess today I was lucky though, since I found it immediately. Just remove the "return" line from the hook_field() load op, which isn't necessary since the $items come in by reference.

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/link/link.m...

I'm putting out a 2.3 version today, this'll be included. Thanks!

#2

Anonymous (not verified) - July 13, 2008 - 22:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.