Download & Extend

'title_value' in 'link_field_update_instance' undefined

Project:Link
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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

#1

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.

#2

Status:active» needs review

Hello, attached patch.

AttachmentSize
Fixed_title_value_in_link_field_update_instance_undefined-1914286-3.patch 783 bytes

#3

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

#4

Status:needs review» reviewed & tested by the community

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

#5

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

#6

Patch works for me too, thank you very much.

#7

Thanks, works for me, too

#8

The patch is working for me.

#9

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.

#10

#2 works for me too.

#11

yep, works here too

#12

Seams to work too for me. Thanks !

#13

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

#14

#2 Thanks!

#15

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

#16

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-(

#17

it's work for me too! thanks!

#18

Please commit this patch.

#19

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.

#20

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

#21

Priority:normal» major

Works for me too can we not deploy this!

#22

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

zeropoint.IT

#23

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)

#24

excellent #2!

#25

I can haz commit?

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

Thanks!

#26

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.

#27

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

#28

@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!

#29

Thanks!

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

#30

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

#31

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

#32

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.

#33

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

#34

It works well, thanks.

#35

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

#36

@facine perfecto! gracias una vez más!

#37

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

#38

#2 worked like a charm! Thanks @facine!

#39

Thanks, @facine!

#40

Confirming #2 working with i18n and domain_access. Thanks!

#41

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).

#42

#2 worked, thanks facine.

#43

#2 worked for me too, thanks.

#44

works!!

#45

Thanks for the patch, @facine

#46

Lovely, can this be committed asap?

#47

Applied the patch manually and it works, thnx!

#48

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

#49

Version:7.x-1.1» 7.x-1.x-dev

#50

With #2 error disappear.

#51

Patch worked like a charm. Thanks Alex!

#52

worked for me too!

#53

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

You don't say?

AttachmentSize
youdontsay.png 89.8 KB

#54

works for me too ;)

#55

Thank you #2 facine, it worked

#56

Patch provided on #2 works very well.

Can this be committed please?

#57

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

#58

Patch works for me too! Cheers!

#59

+++ 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?

#60

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

#61

Come on!! Somebody commit it!

#62

#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

#63

It works Indeed

#64

Works on i18n with multiple enabled languages.

#65

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

#66

#53 That's freakin hilarious!

#67

+1 for committing the patch.

nobody click here