To reproduce the issue:

-Open a view containing a link field with Formatter=Domain, as link.
-At admin/reports/, open the Recent log messages, it will show the following notice:

Notice: Undefined index: display_url in theme_link_formatter_link_domain() (line 969 of ...\sites\all\modules\link\link.module).

Comments

frost’s picture

I can repro this with the release version.
Same error with the dev release, but line number is 1018

dqd’s picture

Status: Active » Postponed (maintainer needs more info)

@xn2014: can you please provide more infos? Which Drupal core version, and which other modules are involved? Did you use Views module to create the view, or the Drupal manage/display fields or Display suite? Are the user inputs filled in as expected from the field settings? Even if not it would be a bug, since there should be validation to prevent this Error message. While Undefined index is a minor warning which occurs often in Drupal world (sadly) without any trouble, it is not very beautiful :-) So, let's get it fixed.

pjbarry21’s picture

I'm also getting this. When I upgraded to Link 7.x-1.3 (got the error in 1.2, as well), the error line jumped from the original (969 -- same as original post) to 1033. The view was created using views (block). When I change to any other Formatter in the view, the error disappears.

For my site -- core 7.33, views 7.x.-3.8.

Thanks!

N20’s picture

Having the same notice showing empty fields in a panel:

Notice: Undefined index: display_url in theme_link_formatter_link_domain() (line 1074 of /var/www/public/sites/all/modules/contrib/link/link.module).

i changed line 1074 from:

$domain = parse_url($vars['element']['display_url'], PHP_URL_HOST);

to:

!empty($vars['element']['display_url']) ?
  $domain = parse_url($vars['element']['display_url'], PHP_URL_HOST) : NULL;

for now.

ja09’s picture

I was having a similar issue with a proximity search for ~3000 nodes imported with feeds...

Notice: Undefined index: display_url in theme_link_formatter_link_domain() (line 1074 of /srv/bindings/.../code/sites/all/modules/link/link.module).

Turns out this error shows with the search results for every node that didn't have a link field imported, even though the field isn't required.

If I edit the affected nodes and just resave without touching anything, the error goes away. The link field is still blank/empty.

Hope this helps someone.