Geeklog-Plugins / downloads

1 stars 0 forks source link

Sitemap error when saving a File on Edit (and probably New) #24

Open eSilverStrike opened 2 years ago

eSilverStrike commented 2 years ago

Saw these errors in the error log after adding the Geeklog v2.2.2 article on Geeklog.net.

Tue Sep 27 12:46:26 2022 - 123.123.123.123 - XMLSitemap::submitURL: url is not specified to ping IndexNow with.  
Tue Sep 27 12:48:05 2022 - 123.123.123.123 - XMLSitemap::submitURL: url is not specified to ping IndexNow with.  
Tue Sep 27 12:55:12 2022 - 123.123.123.123 - XMLSitemap::submitURL: url is not specified to ping IndexNow with.  
Tue Sep 27 12:58:00 2022 - 123.123.123.123 - XMLSitemap::submitURL: url is not specified to ping IndexNow with.  

After some checking it appears to be from when I edit and save a file from a Downloads (not the actual file but the Downloads Edit form).

I think it is because the URL field is missing from plugin_getiteminfo_downloads... hmmm maybe not as after a quick check it is there... further investigation is required (maybe it is a Sitemap plugin issue, but I doubt it)

eSilverStrike commented 2 years ago

Also should confirm Downloads Sitemap supports new API like pluginidToURL

Update the plugin to support the new Sitemap plugin API found in Geeklog v2.2.2. It allows the sitemap plugin to update individual entries. See:

https://github.com/Geeklog-Core/geeklog/issues/1050

and see:

API changes involved are:

PLG_itemSaved($id, $type, $old_id = '', $sub_type = '') --- $sub_type was added PLG_itemDeleted($id, $type, $sub_type = '') --- $sub_type was added PLG_idToURL($type, $sub_type, $item_id) --- new API. Since PLG_getItemInfo() fails for an item already deleted, I added this API to get the URL of the old item.