I'm trying to update Simple XML sitemap 4.1.7 to Simple XML sitemap 4.1.8. Using the following command in composer as recommended. composer require 'drupal/simple_sitemap:^4.1'.

The response is 'Nothing to install, update or remove'. I then tried using composer require 'drupal/simple_sitemap:^4.1.8'.

The response is the same. Yet the package remains in need of update. Would it be appropriate at this point to do a manual update or is there a magic solution I'm unaware of? 

Comments

ressa’s picture

holljac’s picture

I followed everything presented by that link. It still responds with nothing to be done. Simple XML Sitemap is still at 4.17 and the recommended version is 4.18. I then ran composer outdated "drupal/*". The reply was "Everything up to date". I also ran drush updatedb and drush cache:rebuild and finally drush config:export --diff. That created a hundred or more files that mean nothing to me. So, I'm still at the same problem of not being able to up the module.

lariska’s picture

Maybe one of installed modules has dependencies "Simple XML Sitemap" exactly at 4.17 ?

Try composer why-not drupal/simple_sitemap 4.18

ressa’s picture

I only linked to that page, because you have stated that you tried with composer require but you need to run composer update.

You could try deleting composer.lock ...

holljac’s picture

First I ran composer update to make sure composer was up to date.

Next I ran composer update 'drupal/simple_sitemap:^4.1'.

Still says nothing to do. So I deleted the composer.lock file.

Then reran composer update 'drupal/simple_sitemap:^4.1'.

Didn't work.

ressa’s picture

That's annoying. I since realized that deleting composer.lock is probably not a great recommendation.

Perhaps you can share your composer.json file?

holljac’s picture

{
    "name": "drupal/legacy-project",
    "description": "Project template for Drupal 9 projects with composer following drupal/drupal layout",
    "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/admin_toolbar": "^3.4",
        "drupal/ckeditor": "^1.0.2",
        "drupal/color": "^1.0.3",
        "drupal/core-composer-scaffold": "^10.1.6",
        "drupal/core-project-message": "^10.1.6",
        "drupal/core-recommended": "^10.1.6",
        "drupal/core-vendor-hardening": "^9.5",
        "drupal/font_resize": "^9.0",
        "drupal/quickedit": "^1.0",
        "drupal/rdf": "^2.0",
        "drupal/seven": "^1.0",
        "drupal/simple_sitemap": "^4.1.8",
        "drush/drush": "*"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "drupal/core-project-message": true,
            "drupal/core-vendor-hardening": true,
            "dealerdirect/phpcodesniffer-composer-installer": true,
            "phpstan/extension-installer": true,
            "php-http/discovery": true
        },
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "./"
            }
        },
        "installer-paths": {
            "core": [
                "type:drupal-core"
            ],
            "libraries/{$name}": [
                "type:drupal-library"
            ],
            "modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "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/legacy-project template!               </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/installing-drupal",
                "  * 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"
            ]
        }
    },
    "require-dev": {
        "drupal/core-dev": "^10"
    }
}
 

ressa’s picture

Thanks, I get simple_sitemap 4.1.8:

$ composer install
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 175 installs, 0 updates, 0 removals
  - Locking asm89/stack-cors (v2.2.0)
[...]
  - Locking drupal/simple_sitemap (4.1.8)
  - Locking drush/drush (12.4.3)
  - Locking easyrdf/easyrdf (1.1.1)
[...]
ressa’s picture

Also, this is the syntax, from the documentation page (you are including the version):

composer update drupal/modulename --with-all-dependencies
holljac’s picture

When I scroll back in my putty history, the last command was: composer update 'drupal/simple_sitemap:^4.1' --with-all-dependencies 

ressa’s picture

As I wrote, you are including the version:

composer update 'drupal/simple_sitemap:^4.1' --with-all-dependencies

This is the syntax from the documentation page, without the version:

composer update drupal/simple_sitemap --with-all-dependencies

holljac’s picture

I'm including version because that is what is shown on the module and given to you to copy.

Should there be a second example that says "If you are updating use this: composer update drupal/simple_sitemap --with-all-dependencies"?

ressa’s picture

What do you mean? It says it right there -- the version is not included:

composer update drupal/modulename --with-all-dependencies
holljac’s picture

When I am logged into my site and look at available updates, it lists all the modules in a row. The ones that need updating are highlighted with a different color. Underneath the module name and version it says recommended version. To the right of that it shows a link to 4.1.8 (2023-Dec-18). When you click on that it takes you to a page for simple sitemap with the install syntax.

ressa’s picture

Yes, but that's only for installing. You want to update, that's something else.

holljac’s picture

 composer update drupal/simple_sitemap --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
90 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
Scaffolding files for drupal/core:
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess

In Filesystem.php line 288:

  Could not delete /home3/bpbowsco/public_html/sites/default/default.services
  .yml:

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]

jjgw’s picture

Another approach might be:
- write down all your settings of simple_sitemap
- remove the references to the module from the database via /admin/modules/uninstall 
- remove the references to the module from composer.json and .lock with command: composer remove drupal/simple_sitemap 
- install the latest version of simple sitemap with composer, install in Drupal and reconfigure again

holljac’s picture

I found that for some reason I have 2 versions of simple_sitemap installed. One is under modules (version 4.1.7) and the other is under contrib/modules (version 4.1.8). According to my composer.json I have 4.1.8 installed. It turns out it is identical on my home version of the site. If I just delete the 4.1.7 folder that's in the modules folder, that's not being reference in the composer.json, my site breaks. If I put it back, all is well. So I uninstalled the module and then deleted the folder under modules. Site is not broken, fully functional. I then deleted  the folder under modules/contrib. No issues. Sweet. So I then us composer require 'drupal/simple_sitemap' and it gets installed, just one copy of 4.1.8, in modules/contrib. The site works perfect. So now I move on to the live site. I duplicated my efforts from home and have successfully updated simple_sitemap (one copy) without borking my site. Thank you all for the help.