Attempting a Preview on a Content Type with a Link field without a Title, it assumes there is a title and does not check first.

Notice: Undefined index: title in _link_sanitize() (line 595 of /websites/modules/contrib/link/link.module).

Problem code:
// Use the title defined by the user at the widget level.
elseif (drupal_strlen(trim($item['title']))) {
$title = $item['title'];
}

Comments

naidim created an issue. See original summary.

naidim’s picture

Simple fix, just added an isset() check before the length check.

steinmb’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Status: Active » Needs review
fls-pcate’s picture

Status: Needs review » Reviewed & tested by the community

Patch worked for me.

renatog’s picture

Really Works good.

Thank you very much.

  • RenatoG committed 6292725 on 7.x-1.x authored by naidim
    Issue #2974486 by naidim: Title field assumed when it may not exist
    
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the dev branch.

Thanks.

Status: Fixed » Closed (fixed)

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

AlexandreNarten’s picture

Working great for me too!
Any chance this will this be pushed to a new version ?
I'm running this on a production site and not to keen on keeping a dev module enabled in case you're working on other modifications which are "not secure ?"