Look at comment
I just updated the location module and am getting the following errors:
Error message
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined index: in location_cck_tokens() (line 628 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined index: in location_cck_tokens() (line 628 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined index: in location_cck_tokens() (line 628 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Notice: Undefined index: in location_cck_tokens() (line 628 of /mnt/stor09-wc1-ord1/783602/www..../web/content/sites/all/modules/location/contrib/location_cck/location_cck.module).
Comment | File | Size | Author |
---|
Comments
Comment #1
alexweber CreditAttribution: alexweber commentedConfirmed this happens on 3.0, just upgraded and noticed this too.
Comment #2
alexweber CreditAttribution: alexweber commentedPretty simple fix from this comment.
Comment #3
alexweber CreditAttribution: alexweber commentedActually not that simple, going over the code again, we're not stripping [] from the token so $entity has a leading "[" and $field gets a trailing "]".
Also, the code on line 628 triggers an "undefined index" notice, so maybe we should check for array_key_exists before evaluating it.
Comment #4
alexweber CreditAttribution: alexweber commentedSecond stab... this one works better.
Went out on a limb with the replacing of square brackets, might be a bad idea, plz correct...
Comment #5
BenStallings CreditAttribution: BenStallings commentedFix in #4 worked for me! Thanks, alexweber!
Comment #6
Faeton CreditAttribution: Faeton commentedAfter applying the #4 patch, the first notice message still remains:
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 ...
Comment #7
podarokdue to #6
Comment #8
podarokanybody can reproduce this via tests?
Comment #9
monnerat CreditAttribution: monnerat commentedAfter applying patch #4, I still have a single
Notice: Undefined offset: 1 in location_cck_tokens() (line 622...
Dumping
$name
and$original
shows both variable values aretitle
. Callingexplode(':', 'title')
gives a single element array, so$field[1]
is unset...Comment #10
zilla CreditAttribution: zilla commentedstill getting this error pre-patch (though it works just fine on my site beyond annoying errors text :) - may be worth pushing an update quickly for this one patch before users update this week and start hammering this forum!
Comment #11
Road Runner CreditAttribution: Road Runner commentedI am also getting these error
Notice: Undefined index: in location_cck_tokens() (line 628 of /home/kitchena/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module).
Also get thiserror with it
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /home/kitchena/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module).
after update to latest location and latest gmap.
As previously mentioned there seems to be no other site problems except annoying error messages filling log. This seems to occur when I edit a record with or without location enabled.
TIA
Comment #12
tvasilia CreditAttribution: tvasilia commentedLooks like the revised patch at #4 worked great in my case !
I used it to import a few nodes using feeds with location_cck fields...
Thanks.
Comment #13
jags880 CreditAttribution: jags880 commentedI tried out #4 and while I still get the "Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of ..."
The other error of "Notice: Undefined index: in location_cck_tokens() (line 628 of ..." is gone.
Anyone else?
Comment #14
MikeCermak CreditAttribution: MikeCermak commentedsame here; we've implemented a temporary IF statement to suppress display of those messages, but are awaiting a full fix
Comment #15
Kolo CreditAttribution: Kolo commentedSame here.
Comment #16
Bagz CreditAttribution: Bagz commentedIf it is of any help, the error messages only appear for me when visiting a page for the first time after clearing the cache.
Comment #17
alexweber CreditAttribution: alexweber commented@Bagz that's because token (and most other) hooks get cached and so the error is only thrown when it's rebuilt...
Anyone else wanna take a stab at this?
Comment #18
creeksideplayers CreditAttribution: creeksideplayers commentedI'm still having this problem, even after upgrading to 7.x-3.1
Comment #19
podarokOn Clean install I can`t reproduce this bug
Possible it has data entered dependency and needs upgrade path fixing
So please, can You give us more information about it with full steps to reproduce a bug on clean or working installation with database information
Good to see a SimpleTest test patch with workaround to reproduce
Thanks
Comment #20
zilla CreditAttribution: zilla commentedditto on 18 above, still getting the issue after most recent update.
Comment #21
Didier Misson CreditAttribution: Didier Misson commentedsame problem again, even after upgrade 7.x-3.1.
Comment #22
DrupalHack CreditAttribution: DrupalHack commentedSame.
The error persists after downgrading the back-end back to 7.x-3.dev.
I'm also unable to deactivate the module. If I deactivate from the system table the site won't load.
I'm afraid I'm going to have to delete all location data from the site unless some kind soul works out a patch soon.
Comment #23
Perignon CreditAttribution: Perignon commentedPatch in #4 works. Applied patch and did thorough cache cleaning and the red-box-of-death seems to have dissappeard
Comment #24
creeksideplayers CreditAttribution: creeksideplayers commentedPatch #4 works for me as well. The problem was occurring whenever I added or edited content.
Comment #25
podarok#4 commited pushed to 7.x-3.x
will be tagged for next upcoming release
Thanks!!!
Comment #26
alexweber CreditAttribution: alexweber commentedAwesome, thanks!
Comment #27
Gyver06 CreditAttribution: Gyver06 commentedHi,
I confirm still same error as #6. This patch is not yet fully ready as it is. It needs more testing.
Thank you.
Comment #28
podarokdue to #27
Comment #29
podarokstatus
Comment #30
podarokComment #31
podarokComment #32
Perignon CreditAttribution: Perignon commented@Gyver If you don't preform a clear all cache after you apply the patch you will still see the error. Can you re-attempt the patch and do a thorough cache cleaning afterwards?
Comment #33
Gyver06 CreditAttribution: Gyver06 commentedHi,
I have already cleaned all the cache several times, before and after applying the patch. The error appears when my document is promoted to the front page. Here enclosed is the backtrace of the displayed error if that can help you.
Best regards.
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /home/monrtier/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module). Backtrace:
location_cck_tokens('entity', Array, Array, Array)
call_user_func_array('location_cck_tokens', Array) module.inc:857
module_invoke_all('tokens', 'entity', Array, Array, Array) token.inc:178
token_generate('entity', Array, Array, Array) token.tokens.inc:810
token_tokens('node', Array, Array, Array)
call_user_func_array('token_tokens', Array) module.inc:857
module_invoke_all('tokens', 'node', Array, Array, Array) token.inc:178
token_generate('node', Array, Array, Array) entity.inc:269
ctools_context_entity_convert(Object, 'title', Array) context.inc:532
ctools_context_convert_context(Object, 'title', Array) context.inc:680
ctools_context_keyword_substitute('%node:title', Array, Array) panels.module:712
panels_display->get_title() PanelizerEntityDefault.class.php:2134
PanelizerEntityDefault->render_entity(Object, 'teaser') panelizer.module:275
panelizer_entity_view_alter(Array, 'node', NULL, NULL) module.inc:1063
drupal_alter(Array, Array, 'node') node.module:1366
node_view(Object, 'teaser', NULL) node.module:2676
node_view_multiple(Array) node.module:2707
node_page_default()
call_user_func_array('node_page_default', Array) pm_existing_pages.inc:125
pm_existing_pages_pm_existing_pages_page(Array)
call_user_func_array('pm_existing_pages_pm_existing_pages_page', Array) menu.inc:517
menu_execute_active_handler() index.php:25
Comment #34
Gyver06 CreditAttribution: Gyver06 commentedWhen I save my document, I get this errors :
Notice: Undefined index: wkt in openlayers_proximity_build_proximity_index() (line 248 of /home/monrtier/public_html/sites/all/modules/openlayers_proximity/openlayers_proximity.module). Backtrace:
openlayers_proximity_build_proximity_index(Object)
call_user_func_array('openlayers_proximity_build_proximity_index', Array) module.inc:857
module_invoke_all('build_proximity_index', Object) openlayers_proximity.module:222
openlayers_proximity_build_node_index(Object) openlayers_proximity.module:43
openlayers_proximity_node_update(Object)
call_user_func_array('openlayers_proximity_node_update', Array) module.inc:857
module_invoke_all('node_update', Object) node.module:1185
node_save(Object) i18n_node.module:465
i18n_node_form_submit(Array, Array) form.inc:1464
form_execute_handlers('submit', Array, Array) form.inc:860
drupal_process_form('ol_locator_location_node_form', Array, Array) form.inc:374
drupal_build_form('ol_locator_location_node_form', Array) node_edit_form.inc:70
ctools_context_create_node_edit_form(, Object, , Array) context.inc:600
ctools_context_create('node_edit_form', Object) node_edit.inc:36
ctools_node_edit_context(Object, Array, ) context.inc:796
ctools_context_get_context_from_argument(Array, Object) context.inc:852
ctools_context_get_context_from_arguments(Array, Array, Array) context-task-handler.inc:333
ctools_context_handler_get_task_contexts(Array, '', Array) node_edit.inc:92
page_manager_node_edit(Object)
call_user_func_array('page_manager_node_edit', Array) menu.inc:517
menu_execute_active_handler() index.php:25
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /home/monrtier/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module). Backtrace:
location_cck_tokens('entity', Array, Array, Array)
call_user_func_array('location_cck_tokens', Array) module.inc:857
module_invoke_all('tokens', 'entity', Array, Array, Array) token.inc:178
token_generate('entity', Array, Array, Array) token.tokens.inc:810
token_tokens('node', Array, Array, Array)
call_user_func_array('token_tokens', Array) module.inc:857
module_invoke_all('tokens', 'node', Array, Array, Array) token.inc:178
token_generate('node', Array, Array, Array) entity.inc:269
ctools_context_entity_convert(Object, 'title', Array) context.inc:532
ctools_context_convert_context(Object, 'title', Array) context.inc:680
ctools_context_keyword_substitute('%node:title', Array, Array) panels.module:712
panels_display->get_title() PanelizerEntityDefault.class.php:2134
PanelizerEntityDefault->render_entity(Object, 'teaser') panelizer.module:275
panelizer_entity_view_alter(Array, 'node', NULL, NULL) module.inc:1063
drupal_alter(Array, Array, 'node') node.module:1366
node_view(Object, 'teaser', NULL) node.module:2676
node_view_multiple(Array) node.module:2707
node_page_default()
call_user_func_array('node_page_default', Array) pm_existing_pages.inc:125
pm_existing_pages_pm_existing_pages_page(Array)
call_user_func_array('pm_existing_pages_pm_existing_pages_page', Array) menu.inc:517
menu_execute_active_handler() index.php:25
Notice: Undefined offset: 1 in location_cck_tokens() (line 622 of /home/monrtier/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module). Backtrace:
location_cck_tokens('entity', Array, Array, Array)
call_user_func_array('location_cck_tokens', Array) module.inc:857
module_invoke_all('tokens', 'entity', Array, Array, Array) token.inc:178
token_generate('entity', Array, Array, Array) token.tokens.inc:810
token_tokens('node', Array, Array, Array)
call_user_func_array('token_tokens', Array) module.inc:857
module_invoke_all('tokens', 'node', Array, Array, Array) token.inc:178
token_generate('node', Array, Array, Array) entity.inc:269
ctools_context_entity_convert(Object, 'title', Array) context.inc:532
ctools_context_convert_context(Object, 'title', Array) context.inc:680
ctools_context_keyword_substitute('%node:title', Array, Array) panels.module:712
panels_display->get_title() PanelizerEntityDefault.class.php:2134
PanelizerEntityDefault->render_entity(Object, 'teaser') panelizer.module:275
panelizer_entity_view_alter(Array, 'node', NULL, NULL) module.inc:1063
drupal_alter(Array, Array, 'node') node.module:1366
node_view(Object, 'teaser', NULL) node.module:2676
node_view_multiple(Array) node.module:2707
node_page_default()
call_user_func_array('node_page_default', Array) pm_existing_pages.inc:125
pm_existing_pages_pm_existing_pages_page(Array)
call_user_func_array('pm_existing_pages_pm_existing_pages_page', Array) menu.inc:517
menu_execute_active_handler() index.php:25
Comment #35
podarokGood to see data given at 622 line of
/home/monrtier/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module
backtraces are not friendly for this bug
Can You post here some var_dumps of variables?
Comment #36
podarokhiding commited patch
Comment #37
podarokhere is a debug patch for getting all the data entered
foreach
blockCan You post here data output after patch applied?
Comment #38
Gyver06 CreditAttribution: Gyver06 commentedI have applied #37 patch. How can I get data output to post ?
Comment #39
podarokGo to path where Notice invoked and there will be debug data
Comment #40
mripra CreditAttribution: mripra commentedhow do i patch without terminal access to me site?
Please help.
Thanks
Comment #41
podarok#40 if Your question about patch in #37 - You should manually add one line https://drupal.org/files/issues/2110067-debug-message-do-not-test.patch as You can see here
Previous patches already commited in 7.x-3.x-dev
Comment #42
imoreno CreditAttribution: imoreno commentedHi,
I can confirm that #4 patch did not worked for me. same error are all over the watchdog logs. even after clean all cache files.
Any ideas?
BR
Itzhak
Comment #43
Gyver06 CreditAttribution: Gyver06 commented"Go to path where Notice invoked and there will be debug data"
I am sorry but there is nothing with debug data in the path of the Notice invoqued ie : Notice: Undefined offset: 1 in location_cck_tokens() (line 623 of /home/monrtier/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module)
Any idea ?
Eric.
Comment #44
podarokhm (((
Possibly good to get data dump with code dump of Your site for bug fixing... Is it possible?
Comment #45
LeDucDuBleuet CreditAttribution: LeDucDuBleuet commentedPatch #4 worked for me over v3.1. Thx!
Comment #46
marc.groth CreditAttribution: marc.groth commentedFor what it's worth, patch in #4 worked for me too. No more unsightly errors (and none in error logs either)
Comment #47
Gyver06 CreditAttribution: Gyver06 commentedHow can I get data dump of my site, please.
Comment #48
JeroenTI made a dump of all the variables, and the $original variable was just 'nid' so when you explode this variable $field[1] doesn't exist. patch attached that checks if $field[1] isset.
Comment #49
Gyver06 CreditAttribution: Gyver06 commentedWith this last patch, I have no more the error displayed.
Thank you very much for your time.
Comment #50
monnerat CreditAttribution: monnerat commentedMy own patch version for release 3.1.
It mainly extends #4 in using the token type name as default entity type if a token is not of the form entity:field.
It works for me and suppresses all undefined offset errors. However I would see it tested in situations more complex than my test site...
Comment #52
podarok#48 commited pushed to 7.x-3.x-dev
Thanks!
Comment #53
monnerat CreditAttribution: monnerat commentedMmmm: IMHO #48 suppress the error, but is not quite right:
If the token value is atokenname, it understands it as token type = atokenname and token name = NULL. atokenname would rather be the token name...
Comment #54
mripra CreditAttribution: mripra commentedhow to apply this patch manually?....can some tell me steps to do...i don't have terminal access for my website. Thanks
Comment #55
podarok#53 Just write test for error invoke and fix the bug with a new patch
Comment #56
Kolo CreditAttribution: Kolo commented#54 go to your module folder, find location module. Then go contrib>location_cck folder and find file: "location_cck.module". Open it in editor (I use Adobe Dreamviewer).
Then open patch file for example from #48 post (it works for me!) and find what changes that file. You will see which lines change. Find "-" (this lines must be deleted) and "+" (this lines must be added.
Save, clean caches and it should work ;)
Comment #57
mripra CreditAttribution: mripra commented#56 Ty for reply. but i don't have Location folder in my Module. Can you tell me the path?#52 worked for me. Thanks guys.
Comment #58
yekezei CreditAttribution: yekezei commentedI'm sorry, I'm new and I might have pressed the wrong button.
After applying the patch I still get undefined index: 1 in location_cck_tokens and whatever I fill in the location fields, it doesn't save
Comment #59
imoreno CreditAttribution: imoreno commented#48 did the trick for me, all errors are gone. worked for me.
THX!
Comment #60
podarokjust upgrade Your module to latest dev version and wait until next upcoming stable release builds
Comment #62
agoradesign CreditAttribution: agoradesign commentedNormally, the dev versions are automatically(?) built at night after something was committed, but the last dev release is from 2013-Oct-25, although there were some commits pushed in the meantime. Is there something wrong configured?
Comment #63
podarokre #62 after drupal.org upgrade from 6 to 7 there are gaps in release cycles - so better way to obtain latest version - grab it via
http://drupalcode.org/project/location.git
Link at right of the screen with "snapshot" text
Comment #64
podaroktagged new beta release for this fix https://drupal.org/node/2129291
Comment #65
zilla CreditAttribution: zilla commentedran 3.2 beta 1 and error is GONE - thank you @podarok and everybody else who worked on this!
Comment #66
teamA CreditAttribution: teamA commentedConfirmed as fixed on my site. Thanks everyone!
Comment #67
Reg CreditAttribution: Reg commentedI found that I also got a notice from a couple of lines down. This patch cover that one as well.
Comment #70
michubu CreditAttribution: michubu commented50: drupal7-location-3.1-location-cck-tokens-notices-2119967.patch queued for re-testing.
Comment #72
podarokThis issue already fixed and commited
Feel free to open new if any new bug invoked
Comment #73
rolturn CreditAttribution: rolturn commentedpatch works for me.
Comment #74
erald CreditAttribution: erald commentedpatch #72 works perfectly thanks my logs filled like nuts..
Comment #75
karolus CreditAttribution: karolus commented#4 worked fine for me, as well.
Strangely enough, I couldn't seem to get into the file via CLI to apply the patch, so did it manually. All operations fine. Will the module proper be updated soon?
Comment #76
agoradesign CreditAttribution: agoradesign commentedLike podarok already mentioned: this patch is already committed. It's even already included in the 3.2-beta1 release: https://drupal.org/node/2129291
Comment #77
enzo3946 CreditAttribution: enzo3946 commented#72 work for me too!! Great Podarok!!
Comment #78
ShaneOnABike CreditAttribution: ShaneOnABike commentedWell if it is in the released patch could you deploy that on the frontpage cause you can't actually download it without knowing to go to releases :(
Comment #79
podarokre #78
it described in 3.1 release info with a link to 3.2-beta1 fixed
Users not reading release info should do this.
3.2 release coming soon, but beta releases are useful practice and we shouldn`t break it
Comment #80
podarokComment #81
rick3455 CreditAttribution: rick3455 commentedPatch #4 works for me as well. Awesome...
Comment #82
seehive CreditAttribution: seehive commented#4 works for me with 3.1
Comment #83
BartraB CreditAttribution: BartraB commentedHello,
I got the same errors to. Maybe it's a kind of dumb question, but where and how do apply the patch? Can I go to Filezilla en manually edited a document?
Thanks for the help.
Greetings,
Bart
Comment #84
agoradesign CreditAttribution: agoradesign commentedHi Bart,
best thing is to choose the beta version: https://drupal.org/node/2159879
I don't want to push you, but please read the issue queue more carefully next time, before you ask nearly the same question for the xth time again. It's already mentioned in #76 and #79, that there's a beta version available that includes this bugfix. And also it is mentioned, that the official 3.1 release notes contain a link to the beta release too.
Comment #85
willbxl CreditAttribution: willbxl commented#4 worked fine for me, thank you very much!!!!!
Comment #88
alessandro rancati CreditAttribution: alessandro rancati commentedLocations tokens gave me "Array" as result. Problem gone. Notice gone also. Thank you!
Comment #89
stanoreke CreditAttribution: stanoreke commentedPatch 4# works great for me. Thanks
Comment #90
GenaT CreditAttribution: GenaT commentedhttps://www.drupal.org/files/location-fix-location-cck-tokens-notices-21... worked. Thank you alexweber