Problems setting default site map
3 posts
• Page 1 of 1
Problems setting default site map
Once I have created my first site map, it seems to be impossible to set another site map as the default. When I select a new site map and then click on the set default, I just get a white screen and the setting of the default doesn't change. This happens whether the original map is published or unpublished.
How do I get around this problem please? Is it a bug?
Thanks
How do I get around this problem please? Is it a bug?
Thanks
- Digihound
- Fresh Boarder

- Posts: 2
- Joined: Sat Dec 15, 2012 12:29 am
Re: Problems setting default site map
I also get a similar problem though I get an error message as follows:
Fatal error: Call to a member function getQuery() on a non-object in /administrator/components/com_xmap/models/sitemap.php on line 241
I got around this by editing the existing default xmap to what I wanted as default and creating a new xmap for whatever was in the original default xmap.
P
Fatal error: Call to a member function getQuery() on a non-object in /administrator/components/com_xmap/models/sitemap.php on line 241
I got around this by editing the existing default xmap to what I wanted as default and creating a new xmap for whatever was in the original default xmap.
P
- Protopia
- Fresh Boarder

- Posts: 5
- Joined: Thu Dec 13, 2012 8:10 am
Re: Problems setting default site map
I have now taken a look at the sitemap.php file named in the error message and there is a line of code missing. In the setDefault function you need to add:
$db = JFactory::getDBO();
So the function should look as follows:
function setDefault($id)
{
$table = $this->getTable();
if ($table->load($id)) {
$db = JFactory::getDBO();
$query = $db->getQuery(true)
->update($db->quoteName('#__xmap_sitemap'))
->set($db->quoteName('is_default').' = 0')
->where($db->quoteName('id').' <> '.$table->id);
$this->_db->setQuery($query);
...
I hope this helps.
P
$db = JFactory::getDBO();
So the function should look as follows:
function setDefault($id)
{
$table = $this->getTable();
if ($table->load($id)) {
$db = JFactory::getDBO();
$query = $db->getQuery(true)
->update($db->quoteName('#__xmap_sitemap'))
->set($db->quoteName('is_default').' = 0')
->where($db->quoteName('id').' <> '.$table->id);
$this->_db->setQuery($query);
...
I hope this helps.
P
- Protopia
- Fresh Boarder

- Posts: 5
- Joined: Thu Dec 13, 2012 8:10 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 4 guests