I can't generate a Sitemap.xml file on my new site.
My local stack ;
Apache web server
PostgreSQL 12
PHP 7.4.2

On a PostgreSQL install, you have to install module and try to generate new sitemap.xml

The following error occurs :
Drupal\Core\Database\DatabaseExceptionWrapper : SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "" LINE 2: WHERE "status" = '' ^: DELETE FROM "simple_sitemap" WHERE "status" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => ) dans Drupal\simple_sitemap\Entity\SimpleSitemapStorage->purgeContent() (ligne 552 de /Users/jarjarbinks/PhpstormProjects/Vyv/CVL/web/modules/contrib/simple_sitemap/src/Entity/SimpleSitemapStorage.php).

In SimpleSitemapStorage->purgeContent(), I just cast status parameter to int :
In l.547,
before : $query->condition('status', $status);
after : $query->condition('status', (int) $status);

BR,
MrIss

Comments

MrIss created an issue. See original summary.

spookyisland’s picture

I have the same problem, using PostgreSQL 13.5, also with version 4.1 of this module.

  • gbyte committed 68948fc on 4.x
    Issue #3259127 by gbyte, spookyisland: Can't generate Sitemap with...
gbyte’s picture

Version: 4.0.1 » 4.x-dev
Status: Active » Fixed

There was a casting error I've just fixed. Can you please test the development release and get back to me ASAP? I'd like to create a new stable release.

gbyte’s picture

I added Postgre to the on-commit test bot so we don't run into this in the future.

spookyisland’s picture

I've just tested development release, it works well. Thanks.

Status: Fixed » Closed (fixed)

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

MrIss’s picture

Hello,

The fix works well.

Thank you