Noticed this after upgrading to 7.x-1.1 today -- happens when saving from the "Manage Display" tab on Content Types:

Notice: Undefined index: title_value in link_field_update_instance() (line 1305 of /var/www/foo/public/sites/all/modules/link/link.module)

This appears to fire once for each field regardless of whether or not it's a link. This is happening to me for content types that do not have link fields in them. The implementation of link_field_update_instance does not appear to do any testing to see if the field being modified is a link field.

This sounds similar to the bug at http://drupal.org/node/949604, but the error is happening in new code.

Comments

v.zhakov’s picture

Hello!

I have the same issue.

After I have added this field, it shows twice:

    Notice: Undefined index: title_value ... link_field_update_instance() 
    Notice: Undefined index: title_value ... link_field_update_instance()

(line 1305 in sites/all/modules/link/link.module)

I have Drupal 7.19.

facine’s picture

Status: Active » Needs review
StatusFileSize
new783 bytes

Hello, attached patch.

jcfiala’s picture

A patch! Bless you. Can someone take a look at this?

luisortizramos’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the patch and it seems to work.

peterjlord’s picture

Thanks patch worked to me. Seemed to have occurred when I upgraded from Debian Squeeze to Debian Wheezy which is php 5.4.4-12

Gyver06’s picture

Patch works for me too, thank you very much.

jneubert’s picture

Thanks, works for me, too

weri’s picture

The patch is working for me.

jcfiala’s picture

Thanks folks, I'll try to get this into the dev branch as soon as possible, and do some more testing with i18n over the weekend to try and nail down any other problems that the latest version introduced.

czigor’s picture

#2 works for me too.

7wonders’s picture

yep, works here too

mattlc’s picture

Seams to work too for me. Thanks !

Ted51’s picture

The notice still appears after the first "Save content type" when I create a new content type. For the others cases the patch works for me too. Thanks

ilrecidivo’s picture

#2 Thanks!

opi’s picture

#2 works great. Can't wait for this patch to be applied.

doitDave’s picture

Subscribing, please apply and roll out asap. Hopefully one day PHP will not allow uninitialized variables at all, because this is where that lazy typing stuff lead us to 8-(

navalogan’s picture

it's work for me too! thanks!

webadpro’s picture

Please commit this patch.

jhodgdon’s picture

I applied this patch on a site with i18n, and it works fine to remove the PHP notices, so another +1 for committing it from me.

g0blin79’s picture

Yes it works for me too! Include it in a new module version pleaze! :)

shaneonabike’s picture

Priority: Normal » Major

Works for me too can we not deploy this!

jawad.shah’s picture

ref #2
Yes, patch works perfect.
Thanks facine.

zeropoint.IT

silkogelman’s picture

Commerce Kickstart uses Link 7.x-1.1
Got this notice when upgrading to Commerce Kickstart 2.4 right after running update.php (Drupal core 7.20)

ibarrajo’s picture

excellent #2!

alexweber’s picture

I can haz commit?

Confirm that it works on a website (with i18n).

Thanks!

imagenews’s picture

not sure how to apply this patch, I'll need to load via cpanel because I don't know any other way, what file and where do I add this patch to? Thanks in advance.

herbiek’s picture

Not sure which permissions you have, depending on the method you want to use (manually or via command line interface) you can try following this description: http://drupal.org/patch/apply

alexweber’s picture

@imagenews If you're using unix just follow these simple steps:

  1. cd into the module's directory
  2. wget http://drupal.org/files/Fixed_title_value_in_link_field_update_instance_undefined-1914286-3.patch
  3. patch -p1 < Fixed_title_value_in_link_field_update_instance_undefined-1914286-3.patch
  4. Profit!
maxplus’s picture

Thanks!

#2 worked for me with current Drupal Commerce Kickstart 7.x-2.4 and Link 7.x-1.1

grkm2002’s picture

downloaded patch to link folder and ran the patch command. However I get "patch: **** strip count 1 is not a number"

Any help would be great. Hate having all those notices

alexweber’s picture

if the patch doesn't apply you're probably not using the latest stable release of the module.

jhodgdon’s picture

RE #30 - you may have also used a lower-case L instead of a number 1 when you typed in the patch command in #28. It should be "patch minus lower-case-p number-one" in step 3 of #28. That is what the error looks like to me.

grkm2002’s picture

Thanks. It works. Was using a lower "L" instead of a the number 1.

kurtzhong’s picture

It works well, thanks.

leanderl’s picture

Thanks for the patch in #2! Works like a charm.

hedel’s picture

@facine perfecto! gracias una vez más!

dimitriseng’s picture

I can confirm #2 resolves the issue, please commit, thank you.

flying dutchman’s picture

#2 worked like a charm! Thanks @facine!

oana.hulpoi’s picture

Thanks, @facine!

daniel wentsch’s picture

Confirming #2 working with i18n and domain_access. Thanks!

tusik’s picture

After applying patch #2 I get the following error message

Notice: Undefined index: in theme_field_ui_table() (line 256 of ../modules/field_ui/field_ui.admin.inc).
Warning: Invalid argument supplied for foreach() in element_children() (line 6370 of ../includes/common.inc).

Neli’s picture

#2 worked, thanks facine.

gianfrasoft’s picture

#2 worked for me too, thanks.

vacho’s picture

works!!

wangqizhong’s picture

Thanks for the patch, @facine

kingfisher64’s picture

Lovely, can this be committed asap?

eTech’s picture

Applied the patch manually and it works, thnx!

hswong3i’s picture

#2 also works for me, which I had already apply it to DruStack as reference from Commerce Kickstart.

hswong3i’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
jasom’s picture

With #2 error disappear.

jaimecarrion’s picture

Patch worked like a charm. Thanks Alex!

stred’s picture

worked for me too!

jasom’s picture

StatusFileSize
new89.8 KB

#42 #43 #44 #47 #50 #51 #52 :)

You don't say?

Anonymous’s picture

works for me too ;)

fayedrupal’s picture

Thank you #2 facine, it worked

mxt’s picture

Patch provided on #2 works very well.

Can this be committed please?

johantar’s picture

Patch provided on #2 worked for me. Thank you!

razkovnik’s picture

Patch works for me too! Cheers!

a.ross’s picture

+++ b/link.module
@@ -1302,7 +1302,7 @@ function link_field_item_property_info() {
+  if (function_exists('i18n_string_update') && $instance['widget']['type'] == 'link_field' && $prior_instance['settings']['title_value'] != $instance['settings']['title_value']) {

I would prefer to test for widget type first and only then check the other conditions. But can this please be committed?

seyv’s picture

Patch in #2 fixes the annoying error. Please can this be commited?

raulmuroc’s picture

Come on!! Somebody commit it!

giorgosk’s picture

#9 asks for i18n tests
#19, #25, #40 confirm it to be working on an i18n enabled site
I am also confirming i18n enabled site its working like a charm

please commit at least on the DEV version

Bison’s picture

It works Indeed

aantonop’s picture

Works on i18n with multiple enabled languages.

webadpro’s picture

I think this patch as been tested more than enough times and the dev should be committing this patch.

twooten’s picture

#53 That's freakin hilarious!

kobee’s picture

+1 for committing the patch.

kifuzzy’s picture

thx :) to #2 patch .. not very often have to patch and when only by hand .. it works :-) .. (like i had a message as thread opener, using drupal core 7.22)

elgris’s picture

Hi!
This is my first patch, and I did it in mac terminal in a localhost beta site.

I got this message and I have to cancel because I don't know what is the best option.

--------------------------
|diff --git a/link.module b/link.module
|index 241066d..103cde6 100644
|--- a/link.module
|+++ b/link.module
--------------------------

I do this:

image_link_formatter USER$ patch -p1 < Fixed_title_value_in_link_field_update_instance_undefined-1914286-3.patch

I also get the last version of the module, because i downloaded today.

Any help?

Thanks!! have a great day!

facine’s picture

Test with: git apply -v Fixed_title_value_in_link_field_update_instance_undefined-1914286-3.patch

jcfiala’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Patch merged into 7.x-1.x.

Please give the 7.x-1.x-dev version a test soon.

facine’s picture

Please use proper attribution next time.

haphvn’s picture

#2 it's works for me
many thanks

jcfiala’s picture

Please use proper attribution next time

I used what's in the 'git instructions' tab for the module. If they want me to use other instructions, they should be linked to from there.

a.ross’s picture

tot me that commit looked good, but I'll recommend Dreditor anyway. It can create your commit messages for you from the information in a project issue.

facine’s picture

I agree, that should be included in git instructions tab...

But I recommend reviewing official Drupal documentation (http://drupal.org/node/7765), you seems to be somewhat outdated.

That same documentation also "forced" to include README.txt, CHANGELOG.txt, among other things, and debug your code in compliance with the standards. (http://ventral.org/pareview/httpgitdrupalorgprojectlinkgit-7x-1x)

In that same OFFICIAL Drupal documentation can find the link that referred to earlier: http://drupal.org/node/1146430

Anyway, thanks for maintain this module.

ricancie’s picture

Hello everybody!

I have the same problem, but I have no idea how to apply a patch and no idea about git clone either (I am not an IT...). And I don't want to mess up... Is there any other way to solve the issue??

Thanks...

tuwebo’s picture

Hi all,
Patch #2 is working fine for me. Thanks facine!
@ricancie you can read some doc about applying patches here https://drupal.org/patch/apply. You can download the file in comment #2 in sites/all/modules/contrib/link folder. Then go to that folder (command line) and execute
patch -p1 < Fixed_title_value_in_link_field_update_instance_undefined-1914286-3.patch.
It should work. If you can´t you will probably have to wait for the next update version of the module.
Git is really good, you may want to read this tutorial http://gitimmersion.com/ it helped me a lot!

tgolding’s picture

Thank you!

liza’s picture

any reason why this hasn't been committed yet? it's been almost 4 months since the patch was committed :\

moonray’s picture

See #71. It should be committed to dev.

anybody’s picture

Perhaps it would make sense to release a new stable version to make this go away in the most installations? ;)

I think that would be nice, if the .dev is stable enough soon.

raulmuroc’s picture

Completely agree with #82. A stable release would be needed because the patch was test&reviewed by community and committed long time ago.

Thank you :-) for such a nice work!

calbasi’s picture

#28 (and, then #2) is working for me too ;-)

Gastonia’s picture

GEEZ people - unfollowing. Can we just get this committed and quit with this annoying thread of "Me Toos?"

a.ross’s picture

@Gastonia: it was pretty hard to follow, but it has already been committed. :)
Next stable release should have it, whenever that will be.

raphar’s picture

Priority: Major » Minor
Status: Closed (fixed) » Reviewed & tested by the community

#2 works like a charm, thanx!

a.ross’s picture

Priority: Minor » Major
Status: Reviewed & tested by the community » Closed (fixed)

...

yookoala’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Status: Closed (fixed) » Patch (to be ported)

Hello. I'm using the 1.1 version of this module. Seems the patch is not yet applied. Any schedule to apply this patch to the release version?

a.ross’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Patch (to be ported) » Closed (fixed)

7.x-1.1 was released months before this patch was committed. Either use the dev release or wait for 1.2

timothee.moulin’s picture

more than 6 months after, the patch is not yet committed in the last version...

a.ross’s picture

I think you mean 1.2 hasn't been released yet. IMO this issue is sufficiently bad that a 1.2 release should be rushed.

manoloka’s picture

I am also confirming that 2# works in a i18n enabled site

thanks

ero.sante’s picture

#2 worked for me as well. Thank you so much!

afoster’s picture

Status: Closed (fixed) » Reviewed & tested by the community

Patch #2 - working w/ Drupal 7.23 (Pressflow) + i18n 7.x-1.10

a.ross’s picture

Status: Reviewed & tested by the community » Closed (fixed)
lee20’s picture

Status: Closed (fixed) » Reviewed & tested by the community
lee20’s picture

Status: Reviewed & tested by the community » Fixed

This is fixed in the dev version. My mistake.

Harald.Winzer’s picture

Hello,

I have never seen anything like this.

Actually Drupal is a hobby and I work mainly with Unix and so on.

It worked, thanks I will remember this and will show it my local Drupal group.

This was for the Unix comand to apply the Patch.

Now everything is fine!

hass’s picture

Are you going to create a new release soon, please?

dr.osd’s picture

#2 worked for me. Thank you!

mayan62’s picture

Hello
I am a beginner in Drupal and dont know where to add the patch, i have the same issue and want to fix it. Can somebody tell me where exactly ( file and Place in the file) i need to add it?
Thanks a lot Susanne

anybody’s picture

Issue summary: View changes
Status: Fixed » Reviewed & tested by the community

I don't think this is fixed in the latest .dev release, because the last release is 5 month ago. Furthermore this should be considered for a new stable release, I think. Could a maintainer have a look?

anybody’s picture

Status: Reviewed & tested by the community » Fixed

My mistake. It is truely fixed. Here's the link to the commit:
http://drupalcode.org/project/link.git/commit/a464e9d

So it would make sense to create a new stable release perhaps.
Everyone who has a problem with the current stable version should test the current .dev though instead of using the patch (as answer to question #102 by mayan62 above).

hass’s picture

a.ross’s picture

get_last_replies(34)->remove();
jcfiala’s picture

Sorry folks - balancing work, parenthood, and drupal has not been entirely successful. I'm going to put some time in and try to get a new release out soon - at the moment I'm trying to figure out where I am in the project currently and where to go next.

As always, testing and marking tickets reviewed & tested by community helps!

Status: Fixed » Closed (fixed)

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