×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Search result links return 404

Search result links return 404 12 years 9 months ago #12845

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
Even on the compojoom labs page ( http://labs.compojoom.com/index.php/hotspots ) when clicking on a search result it returns a 404.

The problem is with native SEF turned on. When I disabled SEF URLs in Global Configuration the search results worked.

Obviously it's a better option to use SEF URLs then turning them off, so how do we fix this?

Search result links return 404 12 years 9 months ago #12853

  • Eliecer Marchante
  • Eliecer Marchante's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
I am not getting any error inside the hotspot component.

Search result links return 404 12 years 9 months ago #12854

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
Go here - http://labs.compojoom.com/index.php/hotspots

In the joomla search box (top right) enter the keyword "museum". There's 1 result (Staatliche Museum für Naturkunde Karlsruhe ). Click on that result..for me it returns a 404.

Do the same at http://demo.compojoom.com . It doesn't return any results for the hotspots which makes me believe the search plugin is disabled and Daniel knows about this? I don't know, but I DO know that when I turn off native SEF in joomla the problem is fixed.

Search result links return 404 12 years 9 months ago #12855

  • Eliecer Marchante
  • Eliecer Marchante's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
well, that search box is not part of hotspot's component, it's part of the joomla's template.

any results from that search box will be related with the content of the website (articles, etc) and it won't bring any results from the component. At least it's what i think.

Search result links return 404 12 years 9 months ago #12856

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
You're 1/2 right - that search box IS the default joomla box, but that's the purpose of the plugin.

If you install the hotspots search plugin and use the default joomla box it WILL return results for your hotspots, the problem is when native SEF is enabled the links return a 404

Search result links return 404 12 years 9 months ago #12857

  • Eliecer Marchante
  • Eliecer Marchante's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Well,

I didn't know about the existence of 'hotspot search plugin' (my fault), I just installed hotspot, and I can not see any hotspot plugin in joomla 1.6 plug-in manager section at all.

Let's wait for Daniel to clarify this. Now, I am interested to use that plugin in some of my articles.

Search result links return 404 12 years 9 months ago #12858

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
Probably my fault - I should have clarified that I'm using the 1.5 version - but still, http://compojoom.com/downloads/downloads/hotspots/plugins

Search result links return 404 12 years 9 months ago #12861

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Sorry guys! I know about the problem and I am going to fix it eventually... :) I don't know how important the search plugin is going to be anyway when we get the search box in the navigation bar of the component...

For now just disable that plugin.

Search result links return 404 12 years 9 months ago #12885

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
The search plugin is VERY important for this reason - having 2 search boxes is confusing to a lot of people. It's not to us because we're use to using joomla and know how everything works, but in more than one project I've had issues with having 2 search boxes.

Think about it - someone arrives on the homepage and sees a search box - they search for a location without knowing that if they clicked through to the component there would be ANOTHER search box. But, no results turn up so they're gone. This is not an ideal situation, which is why I think you created the plugin to begin with.

If the component was free that's one thing, but I paid for the component and the ability to integrate it with the native joomla search as advertised so "just disable it" doesn't sit well with me. The plugin obviously works, it just doesn't output the link correctly in the results with SEF turned on.

As far as I know there's only one file where the issue could be - plugins/search/hotspots.php. I'm not a coder, but my guess is it's something within these lines:
if(is_array($rows)) {
		foreach($rows as $key => $row) {
			$urlcat = $row->catid . ':' . JFilterOutput::stringURLSafe($row->cat_name);
			$urlid =  $row->id.':'.JFilterOutput::stringURLSafe($row->title);
			$itemId = getHotspotsItemid('com_hotspots');
			$rows[$key]->href = JRoute::_("index.php?option=com_hotspots&view=hotspot&lcatid=" . $urlcat . "&id=" . $urlid . '&Itemid=' . $itemId);
		}
	}
 
	return $rows;
}
 
	/**
	 *
	 * @staticvar <int> $ids
	 * @param <string> $component
	 * @return <int>
	 */
function getHotspotsItemid($component='') {
	static $ids;
	if (!isset($ids)) {
		$ids = array();
	}
	if (!isset($ids[$component])) {
		$database = & JFactory::getDBO();
		$query = "SELECT id FROM #__menu"
				. "\n WHERE link LIKE '%option=$component%'"
				. "\n AND type = 'component'"
				. "\n AND published = 1 LIMIT 1";
		$database->setQuery($query);
		$ids[$component] = $database->loadResult();
	}
	return $ids[$component];
}
?>

Is there ANYONE who can take a look at this for 2 minutes and come up with a solution?

Search result links return 404 12 years 9 months ago #12886

  • Eliecer Marchante
  • Eliecer Marchante's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
The only search box I am using is the one inside the component.

Without that search box, my website will be useless. Instead to get a url, I prefer to get a marker on the map showing what I am looking for.

I need the search box inside the component, and you need the search box coming with joomla. In that case, both search boxes need to stay. Once people realize how quick, nice, and smooth is the search box coming with the component works, they won't bother to use the one sited outside the component.

I vote for both search boxes. Everybody is happy.

Search result links return 404 12 years 9 months ago #12887

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
I vote for both as well - only one of them isn't working correctly but I don't think it's a major fix.

Search result links return 404 12 years 9 months ago #12893

  • Preston
  • Preston's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
plugins/search/hotspots.php line 99

change
$rows[$key]->href = JRoute::_("index.php?option=com_hotspots&view=hotspot&lcatid=" . $urlcat . "&id=" . $urlid . '&Itemid=' . $itemId);

to this
$rows[$key]->href = JRoute::_("index.php?option=com_hotspots&view=hotspot&catid=" . $urlcat . "&id=" . $urlid . '&Itemid=' . $itemId);

You're basically changing lcatid to catid at the end of the url.

All credit goes to Perry Brumoen for spotting the problem.

Search result links return 404 12 years 9 months ago #12894

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Wow, thanks for sharing the fix! Now I will have less work for the update :)
Regards,
Daniel

Search result links return 404 12 years 9 months ago #13077

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
So guys, in case you want the official plugin :)
compojoom.com/downloads/downloads/hotspo...ots_search20zip/view

It works on joomla 1.5 and 1.7 - thank you for the help!
Daniel
  • Page:
  • 1
Time to create page: 0.155 seconds