Getting the above error with Drupal 6.19 with openlayers 6.x-2.0-alpha10

When on the Manage fields page for the openlayers cck widget field:

admin/content/node-type/<some_openlayers_node_type>/fields/<some_openlayers_cck_field>

Fixed by removing the references in the affected function:

In sites/all/modules/openlayers/modules/openlayers_cck/openlayers_cck.module l306

//function openlayers_cck_widget(&$form, &$form_state, $field, $items, $delta = 0) {
function openlayers_cck_widget($form, $form_state, $field, $items, $delta = 0) {

The function didn't seem to require any of their arguments to be passed by reference.

Note I haven't tested it yet. I'll comment here if these raise issues elsewhere

Comments

zzolo’s picture

Please note that our work was taken from here:
http://www.lullabot.com/articles/creating-custom-cck-fields

This is not to say that your change is not correct, but we definitely need to test this, as that example is from one of the cck maintainers.

dgastudio’s picture

same problem

tmcw’s picture

What version of CCK are you using? I can't recreate this problem with CCK 2.8 or CCK 3.0.

dgastudio’s picture

6.3.dev

zzolo’s picture

Category: bug » support

Its hard to support development versions of modules as it is a moving target. Maybe there is a specific issue or commit that is the reason for this change so that we can begin to look at updating our module to work appropriately for the current stable and future versions.

bc’s picture

Status: Active » Closed (duplicate)

I think that this type of issue is related to php 5.3 support in CCK: see http://drupal.org/node/705512

The function def. in openlayers_cck should have the references, but cck calls that function with &s when it isn't needed.

fonant’s picture

Yes, this is a PHP 5.3 issue, the later version of PHP being more careful about how things are passed to functions.

fonant’s picture

Status: Closed (duplicate) » Active
Issue tags: +PHP 5.3 compatibility

Re-opened as the linked CCK patch doesn't fix this for me.

dasjo’s picture

Category: support » bug

subscribe
having the same problem with cck 2.8 + openlayers 6.x-2.0-alpha10 and php 5.3

getting the error when
- editing a geocoder field in admin/content/node-type/my-node-type/fields/my-field
- editing a node with the field attached.

my WKT field gets populated with GEOMETRYCOLLECTION() which causes maps to not display properly. though i'm not 100% sure if the above error causes this behavior

tmcw’s picture

Status: Active » Closed (duplicate)

Fonant: please respond on the other thread; this is a CCK issue, rather than an OpenLayers issue, and will not be fixed here.

dasjo: also check the other thread. The problem you're seeing is in geocoder, most likely, not OpenLayers.

ccardea’s picture

Sorry to open this up again. I've read through the CCK thread referenced above. There are many reports that their patch has fixed the issue for CCK. Their patch has been committed and I've verified that it is installed on my machine, but it doesn't fix the problem for Openlayers. I've looked through about 10 pages of issues and can't find a duplicate in this queue. If someone has solved this for Openlayers, please let me know.

ccardea’s picture

Status: Closed (duplicate) » Active

The error message states that the problem occurs (value given (instead of reference)) in includes/modules.inc at line 462, which is the module_invoke() function. It looks like another function is calling module_invoke() with the wrong parameters? I'm a little fuzzy on how this all works together.

A comment from API docs:

"It is useful to realize that the args passed to invoked functions are not passed by reference with calls to module_invoke() (or to module_invoke_all(), for that matter)."

So who is calling openlayers_cck_widget() using module_invoke()? The problem goes away by changing the widget type from openlayers_geocoder to openlayers_map. Hmmm.

ccardea’s picture

I used the fix in the original post as a quick fix. It doesn't seem to have any ill effects so far. The real problem seems to be the call to module_invoke() in openlayers_geocoder.

ccardea’s picture

I've provided a patch in openlayers_geocoder that provides a solution without changing the function signature.

http://drupal.org/node/1074436#comment-4144684

tmcw’s picture

Status: Active » Closed (duplicate)

This is a duplicate ticket, then? This module is not OpenLayers Geocoder.

ccardea’s picture

I think the duplicate tag is misleading, since there is no duplicate issue here. It sent me on a wild goose chase.

tmcw’s picture

Status: Closed (duplicate) » Closed (works as designed)

Works as designed, then.

leramulina’s picture

Component: OpenLayers CCK » OL API
Status: Closed (works as designed) » Active

I have
Drupal 6.24
CCK 6.x-3.0-alpha3
Openlayers 6.x-2.0-beta1
Geocoder 6.x-2.0-alpha5

I used patches from here http://drupal.org/node/1074436

And it did not help me

steinmb’s picture

Status: Active » Closed (duplicate)

Read through this thread and quite sure that it is a duplicate of #1074436: warning: Parameter 1 to openlayers_cck_widget() expected to be a reference that work around PHP 5.3.x related warnings/problems. Closing. Pls. test the rerolled patch.