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

#8 1454298-openlayer_ui-stack-trace.txt2.58 KBethanw
Members fund testing for the Drupal project. Drupal Association Learn more


mgifford’s picture

Related 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:

  if (is_object($layer)) {
    $success = $layer->save();

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.

adshill’s picture

I have the same problem - I simply can't add layers due to the error above.

adshill’s picture

mgifford - 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!)



mgifford’s picture

There 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?

Admdebian’s picture

yes, I am

adshill’s picture

Priority: Normal » Critical

Hi mgifford,

To replicate the problem:

  1. Install Drupal 7.12, Views, OpenLayers, CTools
  2. Go to /admin/structure/openlayers/layers/add/openlayers_views_vector
  3. Enter layer details
  4. You will get either the error or a WSOD

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.



adshill’s picture

Its 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...

ethanw’s picture

I'm having the same issue, trying to create a new Openlayer_Views Vector layer. Full stack trace is in file attached.

zzolo’s picture

Status: Active » Fixed

The 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.

adshill’s picture

Status: Fixed » Active

Hi 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.



zzolo’s picture

Hi @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.

zzolo’s picture

Status: Active » Closed (fixed)

I have removed these options from the UI.