How to Fix "Error: 0 - Argument 1 passed to xmap_com_content::getTree() must be an instance of XmapDisplayer"

You may see the following error when opening an OSMap sitemap:

Error: 0 - Argument 1 passed to xmap_com_content::getTree() must be an instance of XmapDisplayer, instance of Alledia\OSMap\Sitemap\Collector given

This error is caused by an outdated Xmap or OSMap content plugin. The old plugin expects a legacy Xmap object that is no longer used by current OSMap versions.

To fix the problem:

  1. Install the latest version of OSMap.
  2. Go to System > Manage > Extensions.
  3. Search for Xmap and remove any old Xmap extensions that are still installed.
  4. Search for OSMap and make sure the current OSMap - Joomla Content plugin is installed and enabled.

Open your sitemap again. OSMap should now be able to process your Joomla articles without the error.