getgrav / grav-plugin-sitemap

Grav Sitemap Plugin

Home Page:https://getgrav.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot delete Additional URLs form

petira opened this issue · comments

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

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
        }

Might be related maybe?
getgrav/grav-plugin-admin#2056