Since upgrading to latest leaflet module (today) I am getting the following message when clearing the cache:

Fatal error: require(): Failed opening required '/modules/contrib/leaflet/leaflet_views/src/Controller/LeafletAjaxPopupController.php' (include_path='.:/usr/local/Cellar/php@7.0/7.0.30/share/php@7.0/pear') in /vendor/symfony/class-loader/ApcClassLoader.php on line 112

(I changed the urls a bit to to hide my local hard drive folder structure)

If there are any other details you might want me to give you I am very willing to help

Comments

benjarlett created an issue. See original summary.

benjarlett’s picture

Issue summary: View changes
itamair’s picture

nothing special changes from 1.2 to 1.3 but what warned here:
https://www.drupal.org/project/leaflet/issues/3033668

I don't know if your error might be related to it, as it seems more related to a class autoload error.
Did you updated the module using composer ? (??), and specifically this command:

composer update drupal/leaflet

because otherwise you are very probably following wrong practices and loosing classes autoload.

Eventually you might try to update (manually) every Leaflet Map Formatter and Views Style settings, as advised in the above mentioned issue.

itamair’s picture

Status: Active » Postponed (maintainer needs more info)
itamair’s picture

It should be an issue related to your specific working setup, as I don't experience any similar matter in my Leaflet 8.x-1.3 build

gun_dose’s picture

I have the same problem. I suppose, it caused by moving leaflet_views to 'modules' subfolder. But I still can't find solution.

PS: I updated to latest version with composer.

itamair’s picture

Ah shit! You are perfectly right. That (probably) broke the controller namespace ... going to fix this

itamair’s picture

Status: Postponed (maintainer needs more info) » Needs work
gun_dose’s picture

@itamair all is ok with namespaces. Some php internal caching 'remembers' old path and php tries to load class from old location. For me it happened in docker container, after recreating of container problem disappeared. But in production environment without docker all is OK.

So I suppose, that solution is to reboot server.

itamair’s picture

ah yes ... just checked. You are right, as namespace is relative to the "leaflet_views" module path.
Minding if ... a workaround would/might be to export configurations (drush cex) then uninstall the leaflet_views module (drush pmu leaflet_views) and then reimport the configurations (drush cim).
This way the leaflet_views module should be re-installed from the new location (?) preserving your previous settings.

itamair’s picture

Status: Needs work » Needs review
itamair’s picture

Status: Needs review » Closed (works as designed)
anruether’s picture

Title: Fatal error on cache clear » Leaflet_views failed opening Fatal error because module dir moved

updating title for reference.