Problem/Motivation

#3304820: Drupal 10 compatibility fixes introduced a new dependency, but it's not enabled on existing sites, causing erros and php notices due to the missing library.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new547 bytes

Here's a patch, similar to existing ones in the module. Note that you do not need to do a cache clear in update functions like previous ones did, Drupal will automatically do that after running updates.

nick hope’s picture

After updating to Geolocation 3.11 with Drupal 9.5.0 and running update.php I was seeing warnings on /admin/reports/updates that the jquery_ui_autocomplete and jquery_ui_menu themes were missing. Patch #2 fixes that for me. Thank you @Berdir. I will post this as a related issue and probable solution on the issue that has popped up in the jquery_ui_autocomplete issue queue.

Here is the full warning I was seeing on /admin/reports/updates:

    User warning: The following theme is missing from the file system: jquery_ui_autocomplete in Drupal\Core\Extension\ExtensionPathResolver->getPathname() (line 63 of core\lib\Drupal\Core\Extension\ExtensionPathResolver.php).

    Drupal\Core\Extension\ExtensionPathResolver->getPathname('theme', 'jquery_ui_autocomplete') (Line: 85)
    Drupal\Core\Extension\ExtensionPathResolver->getPath('theme', 'jquery_ui_autocomplete') (Line: 123)
    Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension('jquery_ui_autocomplete') (Line: 87)
    Drupal\Core\Asset\LibraryDiscoveryCollector->getLibraryDefinitions('jquery_ui_autocomplete') (Line: 66)
    Drupal\Core\Asset\LibraryDiscoveryCollector->resolveCacheMiss('jquery_ui_autocomplete') (Line: 149)
    Drupal\Core\Cache\CacheCollector->get('jquery_ui_autocomplete') (Line: 44)
    Drupal\Core\Asset\LibraryDiscovery->getLibrariesByExtension('jquery_ui_autocomplete') (Line: 58)
    Drupal\Core\Asset\LibraryDiscovery->getLibraryByName('jquery_ui_autocomplete', 'autocomplete') (Line: 68)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array) (Line: 41)
    Drupal\Core\Asset\LibraryDependencyResolver->getLibrariesWithDependencies(Array) (Line: 104)
    Drupal\Core\Asset\AssetResolver->getLibrariesToLoad(Object) (Line: 116)
    Drupal\Core\Asset\AssetResolver->getCssAssets(Object, ) (Line: 312)
    Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object, Array) (Line: 158)
    Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object) (Line: 94)
    Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
    Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object)
    call_user_func(Array, Object, 'kernel.response', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 202)
    Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 190)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 707)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    User warning: The following theme is missing from the file system: jquery_ui_menu in Drupal\Core\Extension\ExtensionPathResolver->getPathname() (line 63 of core\lib\Drupal\Core\Extension\ExtensionPathResolver.php).

    Drupal\Core\Extension\ExtensionPathResolver->getPathname('theme', 'jquery_ui_menu') (Line: 85)
    Drupal\Core\Extension\ExtensionPathResolver->getPath('theme', 'jquery_ui_menu') (Line: 123)
    Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension('jquery_ui_menu') (Line: 87)
    Drupal\Core\Asset\LibraryDiscoveryCollector->getLibraryDefinitions('jquery_ui_menu') (Line: 66)
    Drupal\Core\Asset\LibraryDiscoveryCollector->resolveCacheMiss('jquery_ui_menu') (Line: 149)
    Drupal\Core\Cache\CacheCollector->get('jquery_ui_menu') (Line: 44)
    Drupal\Core\Asset\LibraryDiscovery->getLibrariesByExtension('jquery_ui_menu') (Line: 58)
    Drupal\Core\Asset\LibraryDiscovery->getLibraryByName('jquery_ui_menu', 'menu') (Line: 68)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 70)
    Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array) (Line: 41)
    Drupal\Core\Asset\LibraryDependencyResolver->getLibrariesWithDependencies(Array) (Line: 104)
    Drupal\Core\Asset\AssetResolver->getLibrariesToLoad(Object) (Line: 116)
    Drupal\Core\Asset\AssetResolver->getCssAssets(Object, ) (Line: 312)
    Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object, Array) (Line: 158)
    Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object) (Line: 94)
    Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
    Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object)
    call_user_func(Array, Object, 'kernel.response', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 202)
    Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 190)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 707)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
damienmckenna’s picture

It also needs to be listed as a dependency in composer.json so that it gets picked up via Composer.

damienmckenna’s picture

StatusFileSize
new863 bytes

This includes the necessary composer.json change.

damienmckenna’s picture

FYI when I run "composer validate" it gives this error:

Root package 'drupal/geolocation' cannot require itself in its composer.json

This comes from the require-dev lines that are unnecessary IMHO.

damienmckenna’s picture

I opened a separate issue for the composer problem: #3330861: Fix composer validation errors

damienmckenna’s picture

FYI the change to add the new dependency triggers the problem with the composer.json file, as can be seen by the drupalci status: "PHP 8.1 & MySQL 5.7 updated deps, D9.4 Composer require-dev failure"

nick hope’s picture

Patch #5 still works for me with Geolocation 3.11 with Drupal 9.5.0. Thank you @DamienMcKenna.

christianadamski’s picture

Status: Needs review » Fixed

This is annoying. Anyway, thanks for your help, patch applied.

nick hope’s picture

The comment in the patch (which ends up at line 200 in geolocation.install) should be // Enable jquery_ui_autocomplete., not // Enable geolocation_google_maps. (which has presumably been copied and pasted from the top of geolocation.install). Not a big deal but it may confuse someone later.

Edit: I'll make a revised patch and reopen.

nick hope’s picture

Assigned: Unassigned » nick hope
Status: Fixed » Active
nick hope’s picture

Assigned: nick hope » Unassigned
Status: Active » Fixed
Related issues: +#3331671: Misleading comment in geolocation.install
jjancel’s picture

good morning
No patch works
auto-update error above version 8.x-3.10
What is happening ?
why this jquery_ui_autocomplete dependency

UNRESOLVED DEPENDENCY
jquery_ui (missing)
Geolocation needs this module.
Geolocation - Leaflet needs this module.
UNRESOLVED DEPENDENCY
jquery_ui_autocomplete (missing)
Geolocation needs this module.
Geolocation - Leaflet needs this module.

Is there another module to display a coordinate with Leaflet
Merci

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jjancel’s picture

hello
the latest version does not work

jjancel’s picture

Hello
after research i solved the problem by installing the module https://www.drupal.org/project/jquery_ui_autocomplete
it would be nice if the dependencies were indicated in the description

therobyouknow’s picture

Agree with https://www.drupal.org/project/geolocation/issues/3328967#comment-14924312

In turn, I had to composer install a later version of jquery_ui

I got it working. Here are my failures, then my successes and my composer.json file:

my failures:

$ ./composer require 'drupal/geolocation:^3.12'
./composer.json has been updated
Running composer update drupal/geolocation
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/jquery_ui_autocomplete 2.0.0 requires drupal/jquery_ui ^1.6 -> found drupal/jquery_ui[1.6.0] but the package is fixed to 1.4.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/geolocation 3.12.0 requires drupal/jquery_ui_autocomplete ^2.0 -> satisfiable by drupal/jquery_ui_autocomplete[2.0.0].
    - Root composer.json requires drupal/geolocation ^3.12 -> satisfiable by drupal/geolocation[3.12.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
$ ./composer require 'drupal/geolocation:^3.12'
./composer.json has been updated
Running composer update drupal/geolocation
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/geolocation[dev-3.x, 3.12.0] require drupal/jquery_ui_autocomplete ^2.0 -> satisfiable by drupal/jquery_ui_autocomplete[2.0.0, 2.x-dev (alias of dev-2.x)].
    - drupal/jquery_ui_autocomplete 2.x-dev is an alias of drupal/jquery_ui_autocomplete dev-2.x and thus requires it to be installed too.
    - drupal/jquery_ui_autocomplete[dev-2.x, 2.0.0] require drupal/jquery_ui ^1.6 -> found drupal/jquery_ui[dev-1.x, 1.6.0, 1.x-dev (alias of dev-1.x)] but the package is fixed to 1.4.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/geolocation 3.x-dev is an alias of drupal/geolocation dev-3.x and thus requires it to be installed too.
    - Root composer.json requires drupal/geolocation ^3.12 -> satisfiable by drupal/geolocation[3.12.0, 3.x-dev (alias of dev-3.x)].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
l$ ./composer require 'drupal/jquery_ui_autocomplete:^2.0'
./composer.json has been updated
Running composer update drupal/jquery_ui_autocomplete
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/jquery_ui_autocomplete ^2.0 -> satisfiable by drupal/jquery_ui_autocomplete[2.0.0].
    - drupal/jquery_ui_autocomplete 2.0.0 requires drupal/jquery_ui ^1.6 -> found drupal/jquery_ui[1.6.0] but the package is fixed to 1.4.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
$ ./composer require 'drupal/jquery_ui_autocomplete:^
2.0'
./composer.json has been updated
Running composer update drupal/jquery_ui_autocomplete
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/jquery_ui_autocomplete ^2.0 -> satisfiable by drupal/jquery_ui_autocomplete[2.0.0].
    - drupal/jquery_ui_autocomplete 2.0.0 requires drupal/jquery_ui ^1.6 -> found drupal/jquery_ui[1.6.0] but the package is fixed to 1.4.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
$

now, my successes:

essentially these worked:

./composer require 'drupal/jquery_ui:^1.6.0'
./composer require 'drupal/jquery_ui_autocomplete:^2.0'
./composer require 'drupal/geolocation:^3.12'

full command output of above:

$ ./composer require 'drupal/jquery_ui_autocomplete:^2.0'
./composer.json has been updated
Running composer update drupal/jquery_ui_autocomplete
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking drupal/jquery_ui_autocomplete (2.0.0)
  - Locking drupal/jquery_ui_menu (2.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading drupal/jquery_ui_menu (2.0.0)
  - Downloading drupal/jquery_ui_autocomplete (2.0.0)
  - Installing drupal/jquery_ui_menu (2.0.0): Extracting archive
  - Installing drupal/jquery_ui_autocomplete (2.0.0): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
49 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
$ ./composer require 'drupal/geolocation:^3.12'
./composer.json has been updated
Running composer update drupal/geolocation
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking drupal/geolocation (3.12.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading drupal/geolocation (3.12.0)
  - Installing drupal/geolocation (3.12.0): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
49 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
$

my composer.json file

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 9 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.9",
        "drupal/advagg": "^4.1",
        "drupal/better_exposed_filters": "^6.0",
        "drupal/classy_paragraphs": "^1.0@RC",
        "drupal/color_field": "^2.5",
        "drupal/core-composer-scaffold": "9.3.15",
        "drupal/core-project-message": "9.3.15",
        "drupal/core-recommended": "9.3.15",
        "drupal/crop": "^2.2",
        "drupal/csv_importer": "^1.14",
        "drupal/ctools": "^3.7",
        "drupal/delete_all": "^2.0",
        "drupal/entity_reference_uuid": "^2.0",
        "drupal/fontawesome": "^2.23",
        "drupal/fontawesome_menu_icons": "^1.9",
        "drupal/fontyourface": "^3.6",
        "drupal/geolocation": "^3.12",
        "drupal/gin": "^3.0@alpha",
        "drupal/gin_lb": "^1.0@beta",
        "drupal/gin_toolbar": "^1.0@beta",
        "drupal/google_analytics": "^4.0",
        "drupal/image_widget_crop": "^2.3",
        "drupal/jquery_ui": "^1.6.0",
        "drupal/jquery_ui_autocomplete": "^2.0",
        "drupal/jquery_ui_touch_punch": "^1.0",
        "drupal/menu_export": "^1.3",
        "drupal/migrate_plus": "^5.2",
        "drupal/migrate_source_csv": "^3.5",
        "drupal/migrate_tools": "^5.1",
        "drupal/paragraph_blocks": "^3.0",
        "drupal/paragraphs": "^1.14",
        "drupal/responsive_menu": "^4.4",
        "drupal/search_api": "^1.23",
        "drupal/search_autocomplete": "^2.0",
        "drupal/services": "^4.0@beta",
        "drupal/uuid_extra": "^2.0",
        "drupal/views_tree": "^2.0@alpha",
        "drupal/viewsreference": "^1.7",
        "drush/drush": "^10.6",
        "guzzlehttp/guzzle": "^6.5.5"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}