Commit 4f848d82 authored by GaxZE's avatar GaxZE Committed by pifagor
Browse files

Issue #2914077 by GaxZE, alexrayu, pifagor, GeduR, alex_optim: TypeError:...

Issue #2914077 by GaxZE, alexrayu, pifagor, GeduR, alex_optim: TypeError: Argument 1 passed to xmlsitemap_get_directory() must implement interface Drupal\xmlsitemap\XmlSitemapInterface, instance of stdClass given
parent 23b04ea6
......@@ -358,7 +358,7 @@ function xmlsitemap_sitemap_save(XmlSitemapInterface $sitemap) {
// If the context was changed, we need to perform additional actions.
if (!$sitemap->isNew() && $sitemap->getId() != $sitemap->getOriginalId()) {
// Rename the files directory so the sitemap does not break.
$old_sitemap = (object) ['smid' => $sitemap->old_smid];
$old_sitemap = xmlsitemap_sitemap_load($sitemap->getOriginalId());
$old_dir = xmlsitemap_get_directory($old_sitemap);
$new_dir = xmlsitemap_get_directory($sitemap);
xmlsitemap_directory_move($old_dir, $new_dir);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment