I find that using Openlayers 2.x was working like a charm compared with 3.x.

When updating from OL 2.x to OL 3.x, I always got fatal errors, not matter the order I followed to install required modules or OL library.

When deleting OL 2.x completely and replacing the files with OL 3.x I was able to use Openlayers without a single error.

Now today, the OL 3.x version that was working is now issuing fatal error:

Fatal error: require_once(): Failed opening required '/Users/projets/drupal/sites/all/modules/openlayers/modules/openlayers_ui/src/Plugin/export_ui/OpenlayersComponents.inc' (include_path='.:/Applications/MAMP/bin/php/php5.6.10/lib/php') in /Users/projets/drupal/sites/all/modules/ctools/includes/plugins.inc on line 477

Any debuging tools that I can use to make OL 3.x work again?

Comments

xmacinfo created an issue. See original summary.

m.stenta’s picture

Category: Bug report » Support request
Status: Active » Closed (works as designed)

Openlayers 3 is a complete rewrite from the ground up. There is no automated upgrade path from 2.x to 3.x. You need to rebuild your maps manually. This is more a result of the changes in the underlying Openlayers JS library than it is this module.

The 2.x branch of this module is still being maintained, so you should only upgrade to 3.x if you want/need to, but know that it will involve work on your part to set up your maps again.

From what I've gathered, the current 7.x-3.x branch is broken - @Pol (the primary developer) started working on some things and then got sidetracked, but plans to clean it up soon. In the meantime, 7.x-3.1 is working fine. I am using it in my farmOS distribution (http://drupal.org/project/farm) without any issue.

Regarding your specific error message, make sure you have the new dependencies (Registry Autoload, Service Container, and Libraries CDN is recommended) - and make sure you run a "registry rebuild" via Drush so that the include files are updated in the database registry:

drush rr

Registry rebuild can be found here: https://www.drupal.org/project/registry_rebuild

Hope that helps! Good luck!

xmacinfo’s picture

Status: Closed (works as designed) » Active

In fact, I am using version 3.1.

I now get the famous:

“Fatal error: Class 'Drupal\openlayers\Openlayers' not found in /Users/projets/drupal/sites/all/modules/openlayers/openlayers.module on line 322”.

xmacinfo’s picture

Status: Active » Closed (fixed)

I was able to fix my local installation by using Drush “reinstall modules” command.

Hoping 3.2 will be more stable.

m.stenta’s picture

Hoping 3.2 will be more stable.

Me too - although like I said: 3.1 is working perfectly for me. But I did have to help fix a few bugs to make it work along the way (which were all committed before 3.1 was released). That said, I have a specific use-case, so I may have only fixed the bugs in that line of functioning. You may encounter bugs in areas that I'm not using. Feel free to report them so they can be fixed!