Array errors in location_cck module

atelier - February 12, 2009 - 17:03
Project:Location
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:bdragon
Status:reviewed & tested by the community
Issue tags:location cck, location defaults
Description

I added a Location CCK field to an existing content type (Drupal 6.9). New nodes of this type seem to work fine, but if I edit an existing node, then add data to the Location CCK field, I receive the following error after saving the node (the location data does appear on the node) :

warning: array_filter() [function.array-filter]: The first argument should be an array in ../sites/all/modules/location/contrib/location_cck/location_cck.module on line 387.

warning: array_keys() [function.array-keys]: The first argument should be an array in ../sites/all/modules/location/contrib/location_cck/location_cck.module on line 387.

warning: Invalid argument supplied for foreach() in ../sites/all/modules/location/location.module on line 1657.

Any idea why this might be happening?

#1

likewhoa - February 12, 2009 - 21:14

same issue here, but it only seems to be triggered when manually selecting a location marker and goes away when entering location manually in fields. It seems the marker is not being picked up for new nodes.

#2

atelier - February 13, 2009 - 20:16

I found the following remarks on lines 297-301 of location_cck.module:

      // @@@ There is still a bug here!
      // If you go back and edit something, and you hadn't set a location the
      // first time, CCK fails to set up the defaults properly!
      // I'm just going to leave it like that for now, because I don't know how
      // to work around it.

I'm guessing this is related to the problem I'm having. Do you have an estimate of when this bug might be resolved?

#3

Buffer2k - February 17, 2009 - 07:34

same problem here

#4

jjkiesch - March 12, 2009 - 00:21
Version:6.x-3.x-dev» 6.x-3.1-rc1

i'm getting something similar. at first it was only when editing a previous node, but when trying to create a new node i get the same errors.

warning: array_filter() [function.array-filter]: The first argument should be an array in /Users/jjkiesch/Sites/maraconflict_com/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
warning: array_keys() [function.array-keys]: The first argument should be an array in /Users/jjkiesch/Sites/maraconflict_com/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
warning: Invalid argument supplied for foreach() in /Users/jjkiesch/Sites/maraconflict_com/public_html/sites/all/modules/location/location.module on line 1440.

#5

JaceRider - March 12, 2009 - 03:32

Have the same issue. Haven't found a solution yet.

#6

vegasphotog - March 13, 2009 - 16:07

I think I have having the same issues....on my events calendar...everything was cool until either I added a new event or try to edit an older one.

#7

Buffer2k - March 14, 2009 - 20:38

updating to the latest dev version brings nothing:

    * warning: array_filter() [function.array-filter]: The first argument should be an array in /usr/www/users/tpkskh/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in /usr/www/users/tpkskh/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: Invalid argument supplied for foreach() in /usr/www/users/tpkskh/modules/location/location.module on line 1440.

#8

BWPanda - March 17, 2009 - 02:10
Title:Location CCK error when editing an existing node» Array errors in location_cck module
Version:6.x-3.1-rc1» 6.x-3.x-dev

I can confirm this error too.

I've marked the following issues as duplicates of this one:
#391810: Errors after using Location CCK
#393688: Error when updating a node whith location cck field
#402774: array errors

#9

psynaptic - March 18, 2009 - 14:04

I have found this error just after installing custom_breadcrumbs. Disabling custom_breadcrumbs fixes the issue i.e. no error message appears.

#10

psynaptic - March 18, 2009 - 14:57

Ok, it seemed to be fixed by removing custom_breadcrumbs but the errors are still coming. It seems to only happen on node save for me with the following errors:

warning: array_filter() [function.array-filter]: The first argument should be an array in /sites/all/modules/location/contrib/location_cck/location_cck.module on line 387.
warning: array_keys() [function.array-keys]: The first argument should be an array in /sites/all/modules/location/contrib/location_cck/location_cck.module on line 387.
warning: Invalid argument supplied for foreach() in /sites/all/modules/location/location.module on line 1657.
warning: array_filter() [function.array-filter]: The first argument should be an array in /sites/all/modules/location/contrib/location_cck/location_cck.module on line 387.
warning: array_keys() [function.array-keys]: The first argument should be an array in /sites/all/modules/location/contrib/location_cck/location_cck.module on line 387.
warning: Invalid argument supplied for foreach() in /sites/all/modules/location/location.module on line 1657.

#11

Matt V. - March 18, 2009 - 19:14

For what it's worth, similar errors get displayed when trying to work with location_cck nodes in Views.

#12

jannalexx - March 19, 2009 - 20:50

same error after editing any node with location cck field
warning: array_filter() [function.array-filter]: The first argument should be an array in ...location_cck.module on line 385
warning: Invalid argument supplied for foreach() in ...location.module on line 1440.

#13

andybounce - March 20, 2009 - 20:36

subscribing

#14

HnLn - March 21, 2009 - 13:20

subscribing

#15

MissyM - March 22, 2009 - 03:52

subscribing

It looks like $type == 'field' and $object ->NULL and when array_filter tries to do something with $item['location_settings']['display']['hide'], it generates the error.

function location_cck_token_values($type, $object = NULL) {
if ($type == 'field') {
$item = $object[0];
$location = array(
'hide' => array_keys(array_filter($item['location_settings']['display']['hide'])),
'location' => location_load_location($item['lid']),
);

version = "6.x-3.1-rc1"
core = "6.x"
project = "location"
datestamp = "1236112547"

#16

PeterPresto - March 24, 2009 - 08:35

Changing line 386 from location_cck.module from:

'hide' => array_keys(array_filter($item['location_settings']['display']['hide'])),

to:

'hide' => (isset($item['location_settings'])) ? array_keys(array_filter($item['location_settings']['display']['hide'])) : array(),

and it solved the problem... instead of filling ['hide'] with null if there is no $item['location_settings'] present, it fills ['hide'] with an empty array...

#17

andrewsuth - March 25, 2009 - 15:22

I get the same error but when using CCK Location when adding the field to a Views filter but the error is on a different line of code.

Here is the error message:

warning: array_filter() [function.array-filter]: The first argument should be an array in \sites\all\modules\location\contrib\location_cck\location_cck.module on line 348.

#18

dunx - March 25, 2009 - 16:24

I had the same problem and only after turning on custom_breadcrumbs for this content type.

The above fix seemed to work... or at least the error has gone away.

#19

MissyM - March 28, 2009 - 16:39

Many thanks, Peter!! That worked!

Edit --> Didn't work 100% - would work when I tried to save twice.

#20

giggler - March 26, 2009 - 00:01

subscribe

#21

andrewsuth - March 26, 2009 - 17:34

I hope this will this also be added to the next rc!

#22

jannalexx - March 26, 2009 - 21:44

#16 didn't work here

#23

leoklein - March 27, 2009 - 21:01

#16 worked for me. Not sure why but thanks.

#24

mikeytown2 - March 27, 2009 - 21:38
Status:active» reviewed & tested by the community

taken from #16

AttachmentSize
location_cck.patch 562 bytes

#25

Niko_K - March 31, 2009 - 07:15

Why should you use a

'hide' => (isset($item['location_settings'])) ? array_keys(array_filter($item['location_settings']['display']['hide'])) : array(),

here?
In my installation (i am using a location cck field) isset($item['location_settings']) is true, but array_filter($item['location_settings']['display']['hide']) is still null....

In my opinion the "fix" (in fact it is only hiding the error messages, i am not sure if it is really a fix) should look something like this:

'hide' => (isset($item['location_settings']['display']['hide'])) ? array_keys(array_filter($item['location_settings']['display']['hide'])) : array(),

#26

phd_hiren - March 31, 2009 - 12:39

Patch in #24 worked for me

#27

halver - April 1, 2009 - 12:14

subscribe

#28

BWPanda - April 3, 2009 - 05:56
Status:reviewed & tested by the community» needs work

Marking as 'needs work' as the provided patches don't fix the underlying problem.

I have a content type with location_cck fields - country*, province, city and coordinate chooser* (* = required). When I try to submit a node with a country and coordinates, I get the array errors and no location information is saved to the node.
Applying the above patches (specifically #25) removes the errors, but still no location data is saved to the node, hence the problem remains.
I can successfully save the node if I also set a province (though I shouldn't have to since province isn't required...)

Need to try and find/fix the underlying problem.

#29

bdragon - April 3, 2009 - 18:43
Assigned to:Anonymous» bdragon

able to reproduce. Looking into it.

#30

bdragon - April 3, 2009 - 19:03
Status:needs work» needs review

OK, I think I found the issue. Could I get verification that this fixed it?

http://drupal.org/cvs?commit=192498
http://drupal.org/cvs?commit=192500

#31

redijedi - April 5, 2009 - 02:11

subscribing

#32

Matt V. - April 5, 2009 - 16:11

I just tried uninstalling the Location module on my development site and reinstalling using the latest DEV version of Location instead. I'm still getting errors, when I view a CCK node with Location data associated with it:

    * warning: array_filter() [function.array-filter]: The first argument should be an array in C:\ . . . \sites\all\modules\location\contrib\location_cck\location_cck.module on line 389.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in C:\ . . . \sites\all\modules\location\contrib\location_cck\location_cck.module on line 389.
    * warning: Invalid argument supplied for foreach() in C:\ . . . \sites\all\modules\location\location.module on line 1425.

#33

Matt V. - April 5, 2009 - 16:48

I took a queue from the patches in comment #30 above and tried adding the following at line #388:

      $item['location_settings']['display']['hide'] = array();

That seemed to take care of the error messages I was getting in comment #32 above.

#34

BWPanda - April 6, 2009 - 02:36

Updated to latest .dev version - no more array errors, but still have issues with saving location data to node...

EDIT: I created a separate issue for the problems I'm having, in case it's not related to this issue... #424784: Location data not saved (when only have country filled in, and leave it as the default country) problem w location_strip()

#35

YesCT - April 15, 2009 - 05:56

marked #340994: array_filter() error as duplicate of this issue.

#36

YesCT - April 18, 2009 - 05:22

marked #416230: Location CCK field does not set default location as a duplicate of this issue

also tagging.

#37

fletch11 - April 20, 2009 - 20:20

Just tried the latest release and still getting the array errors as well.

#38

ntt - April 22, 2009 - 12:51

subscribing

#39

epicproblem1 - April 22, 2009 - 19:27

subscribing, same problem

#40

sgriffin - April 24, 2009 - 23:23

subscribing

#41

Enfirno - April 25, 2009 - 02:14

subscribing

#42

mikeytown2 - April 26, 2009 - 00:47
Status:needs review» needs work

Latest Dev doesn't fix this. Error appearing on every page

array_filter() [function.array-filter]: The first argument should be an array in /sites/all/modules/location/contrib/location_cck/location_cck.module on line 389.

Here's that code block

      $location = array(
        'hide' => array_keys(array_filter($item['location_settings']['display']['hide'])),
        'location' => location_load_location($item['lid']),
      );

Original patch should still work... issue should be able to be replicated if your hiding some of the display fields. Alt to patch that I think might be more correct
http://drupal.org/comment/reply/373465#comment-1420184

#43

YesCT - April 27, 2009 - 03:32
Status:needs work» needs review

Try suggestion in #42
And post you results back. This will help review this.

#44

drupalok - April 29, 2009 - 18:59

works for me

#45

YesCT - May 1, 2009 - 11:56

drupalok, which works for you, the original patch or the alternate one mentioned in #42?

#46

droople - May 2, 2009 - 04:42

I get errors upon creating a node with cck_location field

warning: array_filter() [function.array-filter]: The first argument should be an array in D:\wamp\www\ta\sites\all\modules\location\contrib\location_cck\location_cck.module on line 389.
warning: array_keys() [function.array-keys]: The first argument should be an array in D:\wamp\www\ta\sites\all\modules\location\contrib\location_cck\location_cck.module on line 389.
warning: Invalid argument supplied for foreach() in D:\wamp\www\ta\sites\all\modules\location\location.module on line 1434.

#47

steveadamo - May 2, 2009 - 04:54

im getting a similar error when trying to create a view, using the cck_location field... i think ive tried all the suggestions in this thread, but they all seem to be addressing a different line in the location_cck.module file...

my error code is:

warning: array_keys() [function.array-keys]: The first argument should be an array in C:\wamp\www\mysite\sites\all\modules\location\contrib\location_cck\location_cck.module on line 348.

and the entire block of code (from 346 - 364) is:

function theme_location_cck_formatter_default($element) {
  $field = content_fields($element['#field_name'], $element['#type_name']);
  $hide = array_keys(array_filter($field['location_settings']['display']['hide']));
  $location = $element['#item'];
  if (!empty($location['cck_preview_in_progress'])) {
    // Our canary field is in place, we are in a node preview.
    $fields = array();
    // If the delete location checkbox isn't checked, and the location isn't
    // "empty", then theme it based on the current state of the item.
    if (!location_is_empty($location, $fields) && empty($location['delete_location'])) {
      return theme('location', $location, $hide);
    }
  }
  else if (isset($location['lid']) && $location['lid']) {
    // "normal" viewing.
    // Location is already cached by CCK, so no need to load it.
    return theme('location', $location, $hide);
  }
}

#48

steveadamo - May 2, 2009 - 21:10

I had previously tried #16 and #25, but hadnt tried the patch yet... unfortunately, the patch didnt address my problem...

#49

droople - May 2, 2009 - 23:26

Just to clear a few things

The #24 patch works with Location 6.x-3.1-rc1 only. http://ftp.drupal.org/files/projects/location-6.x-3.1-rc1.tar.gz. To solve this error.

* warning: array_filter() [function.array-filter]: The first argument should be an array in /usr/www/users/tpkskh/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in /usr/www/users/tpkskh/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: Invalid argument supplied for foreach() in /usr/www/users/tpkskh/modules/location/location.module on line 1440.

However the latest dev as of May 2, has no working patch yet

#50

steveadamo - May 3, 2009 - 02:24

thanks for the clarification... ill try installing/testing that version on my test site...

i have yet to see that particular error though (looks like there are fewer of us trying to call the location CCK field in a view?)...

#51

steveadamo - May 3, 2009 - 02:53

well, i used the suggestions on the line in question (in my case, line 348), and i could successfully create a View (no error messages)... however, i was also not getting the location data pulled back (no map)... just a blank recordset...

i know the data is there, as im displaying it manually on another page (using the following PHP):

print $node->field_event_location[0]['street'] . '<br/>' . $node->field_event_location[0]['city'] . ' ' . $node->field_event_location[0]['province'] . ' ' . $node->field_event_location[0]['postal_code'] .'<br/><br/>'. (views_embed_view('event_address_other', 'block_1', $node->field_event_location[0]['lid']));

everything works there, with the exception of the view call... no GMAP is displayed (but all the other location fields are printed out)...

i wonder... does it matter that in my location_instance table, that i have 0's for nid, vid and uid? the only values i have (for the cck location records) are genid (cck:field_event_location:4) and lid (8).

#52

droople - May 3, 2009 - 03:21

After applying patch #24 to Rc1, I tried building a view of a node type with a cck field. I got these two errors

    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), node.created AS node_created, location.latitude AS gma' at line 1 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node.created AS node_created, location.latitude AS gmap_lat, location.longitude AS gmap_lon, node.type AS gmap_node_type FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid WHERE (node.status <> 0) AND (node.type in ('hair')) ORDER BY node_created ASC ) count_alias in /home/local/public_html/alpha/sites/all/modules/views/includes/view.inc on line 705.

    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), node.created AS node_created, location.latitude AS gma' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node.created AS node_created, location.latitude AS gmap_lat, location.longitude AS gmap_lon, node.type AS gmap_node_type FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid WHERE (node.status <> 0) AND (node.type in ('hair')) ORDER BY node_created ASC LIMIT 0, 15 in /home/local/public_html/alpha/sites/all/modules/views/includes/view.inc on line 731.

I think I will go back to normal node locations. The only reason I wanted cck locations was the easy manipulation of where to show location fields in a form or node view without complex themeing.

#53

snicers - May 4, 2009 - 15:11

got the same error but only when I'm using cck_locations together with cck_link. As soon as I delete the cck_link field everythings fine.

#54

dirtabulous - May 7, 2009 - 18:47

I was having the same issues. The patch w/ updated from comment 25 appears to fix.
http://drupal.org/comment/reply/373465#comment-1420184

#55

alexw - May 14, 2009 - 10:56

Here's a patch that incorporates the change mentioned in #25. It's made against the 6.3 branch from CVS, and seems to suppress the errors that I was seeing.

To encourage testing, I've also attached a drop-in replacement of the location_cck.module file. Just remove the .txt, and copy over the existing location_cck.module file.

AttachmentSize
location_cck.patch 868 bytes
location_cck.module.txt 12.83 KB

#56

atelier - May 14, 2009 - 13:37

Thanks for packaging this patch into a module. I just tested on D6.10 and it worked perfectly. No errors.

Hopefully, this will make its way into an official release soon!

#57

amcc - May 14, 2009 - 13:51

If i create a very simple node view displaying fields - then select the node title and Content: Location (i'm using a CCK location field) then i get the following error:
warning: array_filter() [function.array-filter]: The first argument should be an array in mysite/sites/all/modules/location/contrib/location_cck/location_cck.module on line 348.

If i limit the view to nodes that contain the location CCK field then that suppresses the error. I still get this with any version 3.0, 3.1 and dev with or without the location_cck.module.txt file from the previous post.

In addition - even when i limit to nodes with the location cck field the view isn't displaying the location info - if i go to the node that information gets displayed properly. E.g. If I put the country into the relevant location field in the node - it displays when i go to node/1 for instance. If i choose to display my CCK field for the location (content - field_location) nothing shows in the view, if I choose to display the location: country field nothing shows in the view

#58

alexw - May 14, 2009 - 18:27

Let's try again...

AttachmentSize
location_cck.module.txt 12.89 KB
location_cck.patch 1.38 KB

#59

Enfirno - May 14, 2009 - 18:43

Using the patch from #58, the warnings have been suppressed (as is the case with #55) however any "Hide Field" settings are now being ignored. That is, all fields (e.g., address, city, etc.) that contain data are displayed when viewing a location CCK field on a node.

#60

alexw - May 15, 2009 - 13:28

Thanks for the review... That's what I get for not testing myself.

Okay this new patch partial fixes the problem, but I've uncovered what seems to be a different problem that I've added a new issue for http://drupal.org/node/463618.

AttachmentSize
location_cck.patch 1.44 KB
location_cck.module.txt 12.94 KB

#61

Elijah Lynn - May 18, 2009 - 23:35

subscribing

#62

giggler - May 19, 2009 - 08:43

thanks! error's gone...

#63

snicers - May 19, 2009 - 08:54

patch #60 works for me. Thank you very much!

#64

atelier - May 28, 2009 - 17:09

This is working for me, as well. What is the status for getting this patch committed?

#65

YesCT - May 29, 2009 - 19:57
Status:needs review» reviewed & tested by the community

#66

bohemicus - June 1, 2009 - 08:08

subscribing

#67

jinglesnbells - June 2, 2009 - 23:22

comment #60

I am still learning drupal. Where do I put the patch? Do I copy and paste it somewhere or just place the file in the location module?

Thanks for your help!

#68

andrewsuth - June 2, 2009 - 23:54

Read the documentation here: http://drupal.org/patch/apply

Patching for the first time can be a little confusing so read the manual well.

#69

GregoryHeller - June 5, 2009 - 22:22

I'm getting this error when a user tries to signup for a node that has the location cck field. I am using the signup module. There is no problem creating the nodes, or editing the nodes as far as i can tell, but when a user attempts to "signup" they get the error.

I am using drupal 6.12, Location 6.x.3.1-rc1, and signup 6.x-1.0-rc3

I have another content type that does not have a location field associated with it, and users can signup for it without incident or error.

#70

andrewsuth - June 5, 2009 - 22:34

Make a new bug report for this module and make sure you post the error message. Unless you think it is directly related to the issue being discussed here.

#71

GregoryHeller - June 6, 2009 - 04:00

I think that this is a related problem, the errors would appear to all be the same:
* warning: array_filter() [function.array-filter]: The first argument should be an array in /modules/contrib-pending/location/contrib/location_cck/location_cck.module on line 385.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /modules/contrib-pending/location/contrib/location_cck/location_cck.module on line 385.
* warning: Invalid argument supplied for foreach() in /modules/contrib-pending/location/location.module on line 1440.

#72

YesCT - June 6, 2009 - 04:53

GregoryHeller, did you try the patch from #60?

#73

Summit - June 8, 2009 - 11:39

Subscribing, had same error, used patch on #60 and looking for new beta release.
greetings,
Martijn

#74

GregoryHeller - June 10, 2009 - 15:32

Just tried the patch from #60 and it seems that it is working. no more errors from location_cck module on signup.

#75

jamesmcd - June 12, 2009 - 19:04

Any plans for the patch being committed soon, now that we are receiving confirmations that it is solving the issue ?

Thanks

#76

drew reece - June 12, 2009 - 19:14

The patch in #60 removes the errors for me. The patch file fails on hunk 2 for me with location 6.x-3.1-rc1, but using the whole module.txt file to replace the location_cck module worked.

Previously I had the following error…

warning: array_filter() [function.array-filter]: The first argument should be an array in sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
warning: array_keys() [function.array-keys]: The first argument should be an array in sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
warning: Invalid argument supplied for foreach() in sites/all/modules/location/location.module on line 1440.

#77

held69 - June 24, 2009 - 08:12

I'm using the latest Gmap 6.x-1.x-dev and Location 6.x-3.1-rc1, but get a little confused here.

Looking at this comment http://drupal.org/node/375259#comment-1735396 i get the feeling i dont need any patch here.

However in the following scenario i'm still getting errors:

-Both Gmap and Location CCK are configured to let users set lattitude and longitude data by using a Gmap.
-Users can also add a postal code

Now when i want to edit a node which has the lat. and long. + postalcode data under contentmanagement by putting a mark before the title and choosing for unpublish and click update i get:

    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home/mysite/domains/mysite.com/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in /home/mysite/domains/mysite.com/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: Invalid argument supplied for foreach() in /home/mysite/domains/mysite.com/public_html/sites/all/modules/location/location.module on line 1440.

#78

sandino - June 25, 2009 - 19:51

subscribing

#79

stripped your speech - June 26, 2009 - 15:49

#60 does not work for me. Using Location CCK with Organic Groups.

What should be done?

#80

held69 - June 27, 2009 - 00:14

I have applied the patch under #60.
It was the first time i applied a patch. I had the same failure as mentioned in #76.
I have applied the replacement mentioned under #76 as well.
Upontil now i didn't get the warnings mentioned under #77

For you out there who dont know how to patch.
This one helped me out: http://indiawebsearch.com/content/how-to-apply-a-patch-to-a-drupal-modul...

@gh0st25 have you applied the replacement mentioned under #77?

#81

J-Chance - June 27, 2009 - 23:12

subscribing

#82

yrre7 - June 28, 2009 - 06:57

subscribing

#83

mrgoltra - July 6, 2009 - 17:15

For those getting an error after patching. Have you tried to disable and enable the affected module?

#84

johnmullin2003 - July 6, 2009 - 20:36

subscribing ...

same issue

* warning: array_filter() [function.array-filter]: The first argument should be an array in /public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 389.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 389.
* warning: Invalid argument supplied for foreach() in /public_html/sites/all/modules/location/location.module on line 1434.

#85

sagannotcarl - July 9, 2009 - 01:43

The patch in #60 is probably made against the dev version. If you are using the the release candidate it won't apply cleanly.

I'm using rc-1 so it didn't apply directly but by making the changes in the patch by hand my problem was solved.

#86

johnmullin2003 - July 9, 2009 - 23:57

I've still got the error in new today dev release.

Should I use the #60 patch?

any info is appreciated.

thanks!

#87

mErilainen - July 10, 2009 - 11:02

I applied #60 patch for latest dev-release and works well. It should be committed to dev.

I still get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;4779219700615*COS(RADIANS(location_node_data_field_homelocation.latitude))*(0,91&#039 ... in file sites/all/modules/views/includes/view.inc

When this happens, the whole map won't load. Weird thing here is, that it works well on my dev-server, but when I commit changes to live-site, I get these SQL errors and maps load rarely.

#88

R.Hendel - July 14, 2009 - 20:58

subscribe

#89

kim.pepper - July 17, 2009 - 04:19

subscribe

#90

YesCT - July 17, 2009 - 08:29

Has anyone reviewed this patch? I'm wondering if the patch fixes the cause of the errors, or just stops them from being outputted.

I'm wondering if #511378: Reworked Location CCK module with GMap formatters might fix these errors.

#91

samhassell - July 21, 2009 - 01:49

subscribing - manually applied the patch @ 60 and it seems to work.

#92

mrgoltra - July 25, 2009 - 18:08

its back.

#93

bdragon - July 28, 2009 - 18:38
Status:reviewed & tested by the community» needs review

Functionally equivalent patch to #60 committed as part of #511378: Reworked Location CCK module with GMap formatters.

(original message)
noahb patch committed.
http://drupal.org/cvs?commit=244004
http://drupal.org/cvs?commit=244006

#94

johnmullin2003 - July 30, 2009 - 10:58
Status:needs review» fixed

Today's New dev release has just fixed location_cck error !!!
Thanks all!

#95

System Message - August 13, 2009 - 11:00
Status:fixed» closed

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

#96

lugha - October 9, 2009 - 05:35

subscribing

#97

kohashi - October 11, 2009 - 16:36

just downloaded and installed everything today... got that 348 line error. placed patch 60 and things just don't save.

#98

wintervanilla - October 21, 2009 - 18:27

Subscribe -- These three errors have have surfaced on our site recently as well. Every instance of the error on our site occurs when accessing a particular content type (press release) within the site.

    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home2/mesaprog/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in /home2/mesaprog/public_html/sites/all/modules/location/contrib/location_cck/location_cck.module on line 385.
    * warning: Invalid argument supplied for foreach() in /home2/mesaprog/public_html/sites/all/modules/location/location.module on line 1440.

I don't know how to confirm this, but I found that in the content type settings, I had the maximum locations set at 0, and the minimum set at 1. This seems like enough of a contradiction to make a computer angry, right? Now that I've set the minimum to 0 as well... the error has not gone away. This could be entirely unrelated but I wanted to mention it to get some helpful feedback.

Cheers,
Andrew

#99

diffstrat - October 28, 2009 - 19:40

subscribing

#100

redben - November 10, 2009 - 12:44
Status:closed» active

Reopened. This still seems to be an issue. For me the warning show up when using custom breadcrumbs module

#101

uomeds - November 12, 2009 - 03:18

Just got this as well.

#102

uomeds - November 18, 2009 - 18:20

Wow well that was easy. Applied

'hide' => (isset($item['location_settings']['display']['hide'])) ? array_keys(array_filter($item['location_settings']['display']['hide'])) : array(),

to line 385 of location_cck.module and it's fixed. Still storing and retrieving locations okay. This is with drupal 6.14 location 3.1-rc1.

Thanks.

#103

Zach Harkey - November 17, 2009 - 09:04

I'm getting the same line 385 error whenever I have the custom_pagers module enabled. When I disable the module, the error goes away.

#104

Architeck - November 18, 2009 - 15:39

I can confirm the fix posted in [#102] works to rid the errors mentioned above and from this issue http://drupal.org/node/633048.

Only thing to note is a typo in the instructions.

Make this change on line 385 in location/contrib/location_cck/location_cck.module, not line 285.

Thanks to uomeds for posting the fix.

#105

boftx - November 20, 2009 - 23:05

subscribe

#106

boftx - November 21, 2009 - 00:58

The problem referred in #51 is also happening for me, is it caused by applying the patch? or is it related at all to this issue?

#107

Daglees - November 24, 2009 - 09:23

Subscribing

#108

chosig - November 25, 2009 - 20:36

#102 fixed it for me.

subscribing

#109

nickl - November 26, 2009 - 04:46
Status:active» reviewed & tested by the community

This has gone on for far too long. Many patches have been broad forward, many users had success, reviewing them, even more users have only subscribed. We are better of closing this leg and starting of new.

Marked as reviewed and tested - please someone confirm this is fixed and start new issues fpr array problems.

 
 

Drupal is a registered trademark of Dries Buytaert.