Closed (fixed)
Project:
Link
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2010 at 17:13 UTC
Updated:
14 Oct 2011 at 19:08 UTC
Jump to comment: Most recent file
Some errors are thrown relating to token after creating a node with a link field:
Notice: Undefined index: enable_tokens in _link_sanitize() (line 472 of /sites/all/modules/link/link.module).
Notice: Undefined index: title in _link_sanitize() (line 510 of /sites/all/modules/link/link.module).
Notice: Undefined index: enable_tokens in _link_sanitize() (line 510 of /sites/all/modules/link/link.module).
(Originally documented here: http://drupal.org/node/696678#comment-3584764)
Note: this is based on the Oct 18 2010 7.1 dev version.
Attached is a proposed patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | 948628_30.patch | 623 bytes | btmash |
| #15 | undefined-index-title-in-_link_sanitize-948628-15.patch | 615 bytes | imiksu |
| #3 | 948628-link-d7_token_errors.patch | 1.65 KB | becw |
| link-d7-token-errors-fix.patch | 1.67 KB | brenk28 |
Comments
Comment #1
das-peter commentedWorks perfectly for me - thanks.
Comment #2
dave reidWe actually need to remove the module_exists('token') since the token_replace() function is provided by core.
Comment #3
becw commentedI'm experiencing the same array key errors. They just look like a typo/oversight. This patch works for me--here's a patch that removes this specific usage of
module_exists('token').Comment #4
becw commentedhttp://drupal.org/node/955864 was a duplicate of this issue but had a more descriptive title.
Comment #5
scotwith1tApplied #3 and still getting
Notice: Undefined index: enable_tokens in _link_sanitize() (line 472 of ...link.module).Comment #6
Eolmornedhel commentedAlso applied #3 and still getting:
Notice: Undefined variable: title in _link_sanitize() (line 513 of /sites/all/modules/link/link.module)
Comment #7
jcarlson34 commentedI am getting the same notice as phrancescot in #5 but only when a url has a question mark query in it.
Like this: http://www.facebook.com/profile.php?ref=profile&id=500042465
Comment #8
jcarlson34 commentedDid some hunting... Looks like a patch in http://drupal.org/node/947050 (see post #1) fixes the "Notice: Undefined index: enable_tokens in _link_sanitize() (line 472 of ...link.module)." issue.
Comment #9
jcfiala commentedOkay, great!
Amusingly, the token module isn't a module anymore, so I also pulled out the module_enabled('token').
Comment #10
dave reidTechnically it is still a module for the token UI and missing core tokens, but yes, to perform token replacement, you don't need the module at all.
Comment #11
jcfiala commentedReally? Huh, hadn't known that.
Well, we'll see how things shake out if we need to go back in and add module_exists or not.
Comment #13
franzkewd commentedGot the following error message on latest 7.x-1.0-beta1:
Notice: Undefined index: title in _link_sanitize() (line 495 of /var/www/vhosts/example.com/httpdocs/sites/all/modules/link/link.module).
Subscribe.
Comment #14
paulbeaney commentedSame here. Just updated to 7.x-1.0-beta1 here too and the error started occurring as per #13.
Comment #15
imiksuHere's a quick fix. See the patch.
Hope it's helping.
Comment #16
franzkewd commentedThanks iMiksu. It works for me.
Comment #17
clauded commentedPatch #15 also worked here.
Comment #18
eewing commentedThanks! Patch #15 worked for me as well.
Comment #19
luke.oakes commented#15 is good :) Thanks.
Comment #20
dqdthx! iMiksu can you please reroll for latest dev again, since I had to make 2 important commits last hour?
Sorry, didn't saw it earlier ...
Comment #21
dqdComment #22
icetristar commentedI had the exact same issue. I was also unable to edit nodes which has a link field. It was throwing some error like "Either title or link has to be set." when I wanted to save node even though the node have both fields were filled.
I went to edit content type / edit link field. I selected set static title and set the static title to token [node:title]. Now both errors disappeared and everything works fine in my case.
Comment #23
bcurry commentedI also had this issue (Notice: Undefined index: title in _link_sanitize()) after updating to 7.x-1.0-beta1 . I attempted to implement patch #15 on a local copy of the link.module file but was unsuccessful. In the end, after reading icetristar's comment #22, I went into "manage fields" for the two link fields my site uses in:
Home » Administration » Configuration » People » Account settings
I didn't actually change anything, I just selected "edit" and re-saved the field and all seems to be fine.
I had cleared the cache and run cron several times before this to no avail.
I'm pleased to see with this update that it seems that including http:// in front of a URL is now optional. Prior to now, I'd have users adding URL's to their accounts and I'd have to manually add the http:// for them if they didn't include it.
Comment #24
dqdthx 4 the reports!
Comment #25
btmash commentedTested out the patch on my site and its working well. The code is also looking sound.
Comment #26
btmash commentedAck...should have marked it as such.
Comment #27
Screenack commentedPatch is working well here, too; though only informally tested
Comment #28
logickal commentedHad this issue pop up today after the latest version of Link was applied. Patch appears to be working fine here.
Comment #29
dqdnope,
patch doesn't match latest dev
Comment #30
btmash commentedOk...patch applied to latest dev.
Comment #31
btmash commentedSetting to 'needs review'
Comment #32
catmoleman commentedJust as in #22 and #23, I was getting that error after upgrading to 7.x-1.0-beta1. I followed the step-by-step instructions in #23 and it worked perfectly. Thanks, bcurry!
Comment #33
jackalope commentedHad this problem today after updating to 7.x-1.0-beta1; problem persisted in 7.x-1.x-dev. The errors went away and the links worked properly in both nodes and views after I edited and saved the link fields; didn't make any changes to the fields, just edited, saved, cleared cache, and all worked well again.
Comment #34
dqd@ BTMash: holy cow! that was fast. ok, wait, I will try to beat it: ... 1 ... 2 ... 3 ... tested. 4 ... 5 ... 6 ... committed to latest dev. bam!
thx! credentials added.
Comment #35
johnlaine commentedSame as #23, I tried clearing the cache several times then just clicked edit and re-saved without making any changes and all was well in the Drupal world.
Comment #36
Foxhaven commentedJust cleared all caches. Problem went away...
Using 7.8, not dev, btw :-/
Spoke too soon. Edited each content type & resaved. Cleared cache.
Still getting notices.
Comment #37
spacereactor commentedUse #30 patch, error is gone after clearing cache. thnk
Comment #38
dqdspacereactor, patch already committed to latest dev
Comment #39
Frederic wbase commentedpatch from #30 worked for me thanks for the effort!
Comment #40
selfuntitled commentedpatch in 30 worked for me as well! Thanks! I'll keep my eyes out for any side-effects.
Comment #41
enricperapatch in 30 also worked for me! Thanks!
Comment #42
Yaazkal commentedPatch in 30 really works.
thanks a lot !
Comment #43
marcorai commentedPatch in #30 worked for me, too! Thanks!
Comment #44
dqd#39, #40, #41, #42, #43 ... patch already committed to latest dev.
Please keep the issues clean!
No need for new reports. Thanks to BTMash and all other contributers.
Comment #45
t0xicCode commentedFor undefined index title in _link_sanitize() errors, please see http://drupal.org/node/1309608