getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Cannot delete Additional URLs form #71

Open petira opened 4 years ago

petira commented 4 years ago

Cannot delete Additional URLs form when it remains last. It reappears after saving.

Grav v1.6.21 - Admin v1.9.12 - Sitemap v1.9.4

marknokes commented 4 years ago

Same here. It adds a bad entry to the sitemap. I hacked the plugin's sitemap.php, beginning line 109 to check for location and lastmod before adding to $this->sitemap[]

foreach ($additions as $addition) {
            $entry = new SitemapEntry();
            $entry->location = $rootUrl . $addition['location'];
            $entry->lastmod = $addition['lastmod'];

            // New check
            if($addition['location'] && $addition['lastmod'])
            {
                $this->sitemap[] = $entry;
            }
            // End new check
        }
Karmalakas commented 3 years ago

Might be related maybe? https://github.com/getgrav/grav-plugin-admin/issues/2056