- Issue created by @hanksterr7
- π¬π§United Kingdom ken-g
Hello @hanksterr7,
I am sorry that you are having problems in upgrading to Openlayers 7.x-3.3.The overall problem is that in 7.x-3.2 and 7.x-3.3 there are many new php classes that have been incorporated into the Openlayers module from the deprecated Service Container module. The Registry Autoload module should then autoload all of these new classes during the upgrade process or when the caches are cleared. However, for whatever reason, if the new classes don't get loaded, then all sorts of errors start appearing.
The best way I have found to tidy up the system, and to remove any traces of the Service Container module, is to rebuild the Drupal registry (using the registry_rebuild module). Please try that and let me know if this works.
Please note that PHP 8.2 did not exist two years ago when I was removing the dependency on the Service Container module, so if you come across any further issues with Openlayers 7.x-3.3 and PHP 8.2, then please raise a separate issue for me to look at.
- πΊπΈUnited States hanksterr7
Blah
I ran registry_rebuild. First time it seemed to work ok, but got this error
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {cache} WHERE (cid LIKE :db_condition_placeholder_0 ESCAPE '\\') ; Array ( [:db_condition_placeholder_0] => entity\_property\_info:% ) in cache_clear_all() (line 173 of /public_html/includes/cache.inc).
Ran it a second time and got no errors
Then tried enabling openlayers module but still get this
PHP Fatal error: Uncaught Error: Class "Drupal\openlayers\DependencyInjection\ServiceProviderPluginManager" not found in /sites/all/modules/openlayers/lib/OpenlayersServiceContainer.php:80
- πΊπΈUnited States hanksterr7
So I know just enough drupal and php to be dangerous :)
I see that
class ServiceProviderPluginManager extends DefaultPluginManager
is defined in
openlayers\src\DependencyInjection\ServiceProviderPluginManager.phpAnd
sites/all/modules/openlayers/lib/OpenlayersServiceContainer.php
says:
use Drupal\openlayers\DependencyInjection\ServiceProviderPluginManager;
$service_provider_manager = new ServiceProviderPluginManager();Why is the code not finding the ServiceProviderPluginManager class?
Is there some code I can add around the call to get an instance of the ServiceProviderPluginManager class to test if it exists?
- π¬π§United Kingdom ken-g
Thanks. I have now corrected the OL project page to state that the separate Service Container module is no longer required for versions 7.x-3.2 onwards of this module.
- πΊπΈUnited States hanksterr7
ok, I finally got OL 3.3 installed. Wasn't pretty
Did these steps:
-- uninstalled OL module and all child modules, and deleted the openlayers folder from sites\all\modules
-- disabled fast 404 (since might interfere with registry autoload) and IP Geoloc (since it had an openlayers2 view component) modules (but did not uninstall)
-- deleted all references to openlayers in registry and registry_file tables
-- ran registry rebuild several times
-- installed OL 3.3 module and enabled it. Didn't crash system!
-- renabled OL submodules, IP Geoloc and fast 404All good
- π¬π§United Kingdom ken-g
Hello @hanksterr7,
I am pleased that you have now managed to successfully install OL 3.3 on your system. Whenever I have seen your original issue of the missing class(es), rebuilding the registry has always worked if clearing the the caches was insufficient. Therefore, I am not sure which one of your steps was the key to resolving your issue, but I am glad it has.
On a related subject, I note that you said your hosting provider recently upgraded your system to PHP 8.2. I know that Drupal Core 7.99 will work with PHP 8.2, but I have not yet attempted to address this for this Openlayers module. Some initial testing over the past couple of days has shown loads of deprecation notices, so I have raised new issue #3425256 - Make Drupal 7 Openlayers compatible with PHP 8.2 π Make Drupal 7 Openlayers compatible with PHP 8.2 Needs review to address this.
Also, following the release of OL 3.3, I had to make a further change to the Service Container code #3362402 - /lib fold not using PSR-0 correctly π /lib fold not using PSR-0 correctly. Fixed . This is already is OL 7.x-3.x-dev and will be released in OL 3.4 in a week or two once I have sorted the PHP 8.2 issues described above.
- πΊπΈUnited States hanksterr7
Ok, thanks. I'll keep an eye on the topics you mention and let you know if I find any php 8.2 problems not addressed by your upcoming fixes
- πΊπΈUnited States hanksterr7
Note, the link in the requirements error message takes me to https://github.com/openlayers/openlayers/releases/download//-dist.zip which is a broken link