Monday, 28 July 2014 06:29
beggarly

Problems setting default site map

An open forum for opinions and general questions

Problems setting default site map

Postby Digihound » Sat Dec 15, 2012 12:50 am

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
Digihound
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Sat Dec 15, 2012 12:29 am

Re: Problems setting default site map

Postby Protopia » Mon Mar 04, 2013 9:11 am

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
Protopia
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Thu Dec 13, 2012 8:10 am

Re: Problems setting default site map

Postby Protopia » Mon Mar 04, 2013 9:45 am

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
Protopia
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Thu Dec 13, 2012 8:10 am


Return to General



Who is online

Users browsing this forum: Bing [Bot] and 6 guests

cron