Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Apache error:
PHP Fatal error: Call to undefined method stdClass::save() in ./sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.layers.inc on line 58, referer: ./admin/structure/openlayers/layers/clone/world_openlayers_1
Comment | File | Size | Author |
---|---|---|---|
#8 | 1454298-openlayer_ui-stack-trace.txt | 2.58 KB | ethanw |
Comments
Comment #1
mgiffordRelated issue but with D6 - #800546: Fatal error in openlayers ui
I can confirm getting this too with the dev version.
EDIT: Just looking at this a bit more. The error is coming in attempting to save the map
$success = $layer->save();
- save is defined in the openlayers.module file as is openlayers_layer_type_load() which is called earlier.But what happens if
$layer = openlayers_layer_type_load($layer_class);
returns false. Would that cause it not to load the object properly. If so then hopefully we'd just be able to do something like:
But that's not working for me. This is the only instance in the OpenLayers module where I'm seeing an object using this function.
Comment #2
adshill CreditAttribution: adshill commentedI have the same problem - I simply can't add layers due to the error above.
Comment #3
adshill CreditAttribution: adshill commentedmgifford - just to confirm are you getting this with every attempt to create a layer?
I was able to create them on another site that I updated and now it doesn't work on there too so I'm wondering if its related to the update? Sounds like so...
Also - if this prevents creating layers entirely should it be marked as critical given that views layers are presumably what a huge number of people are using the module for? (Having said that I'm surprised there are not more reports of the bug!)
Thanks,
Adam
Comment #4
mgiffordThere were some assumptions I didn't get from the docs & looking at the code I got from - http://drupalovereasy.com/drupal-7/tutorials/world-map-photo-album
Things like favouring Geofield over OpenLayers options.
Sorry I can't be more specific or be able to clearly replicate the problem.
EDIT: Are you using dev versions for geofields & openlayers?
Comment #5
Admdebian CreditAttribution: Admdebian commentedyes, I am
Comment #6
adshill CreditAttribution: adshill commentedHi mgifford,
To replicate the problem:
Moving to critical as creating Views layers is a major use of this module and is now not working. I'm going to have to try the new GMap 7 port for now but will help if I can in testing as when views integration works, Open Layers is far superior.
Thanks,
Adam
Comment #7
adshill CreditAttribution: adshill commentedIts weird.. I just tried with an older version of Open Layers because as I say - it worked previously on another site that I had installed. However the alpha version has the same error. This suggests that the problems are due to an update in views or ctools maybe?
Very strange...
Comment #8
ethanw CreditAttribution: ethanw commentedI'm having the same issue, trying to create a new Openlayer_Views Vector layer. Full stack trace is in file attached.
Comment #9
zzolo CreditAttribution: zzolo commentedThe issue here is more that you should not be allowed to clone Views based layers. I have update the UI to remove the clone button for these types of layers. You can clone them in the Views interface.
Comment #10
adshill CreditAttribution: adshill commentedHi zzolo,
I'm not sure you got the issue totally - either that or I've misunderstood something but this is not just cloning - its creating too. If you go to the "add" page on the layers and try to add a views layer the thing crashes with the errors reported here - meaning there is absolutely no way currently using open layers to work with views.
I tried this on a fresh install with only the modules mentioned above (Layers/Views/CTools)
Re-opened, please let me know if I've missed something.
Thanks,
Adam
Comment #11
zzolo CreditAttribution: zzolo commentedHi @adshill. Ah, yes, you should not be able to add a Views layerl manually through the OpenLayers UI. You should be creating them in Views.
Comment #12
zzolo CreditAttribution: zzolo commentedI have removed these options from the UI.