joomla/joomla-cms — pull request #109 by AhmadRusli (2012-01-31 10:55:06+00:00)
Title: Module Weblinks Problem and the Solutions.

===============================================================================================
Module Weblinks Problem
And the Solutions
31 January 2012
================================================================================================

1.	DIRECTION
------------------------
Please open:
Administrator->Extensions->Module Manager->Weblinks

2.	PROBLEM
------------------------------------------------------------------------------------------------
This Mudule (mod_weblinks) displays Website Links.
But an error occure when we want to record how many times the links has been clicked.
The destination links will error, because the link not found when searched in MySQL Database.

When in Mudule, Count Clicks setting up to "No", then no problem, the link will be found,
but when Count Clicks set to "Yes", then this problem appears.

For testing puspose, please set Count Clicks to Yes, then Joomla! should record the clicking.
And Target Window to "Open in a new window", Description to "Hide" and Hits to "Show".
Then publish a Weblink Module to the Front-end. Then click any link as you want.
Then there is a problem comes, Joomla! can not find the URL. Error message: "Web link not found".
Please look at attached file: "Preview-1.jpg".
Joomla! can not bring you to destination URL because the destination URL address can not be found.
How come the URL can not be found, because Joomla! can not find the URL.
How come Joomla! can not find the URL, because there are some error code in Weblinks Module.

For example, the wrong URL (Please look at attached file: "Preview-1.jpg"):
http://localhost/index.php/component/weblinks/?task=weblink.go&catid=&id=32:joomla-specific-links

It should be (Please look at attached file: "Preview-2.jpg"):
http://localhost/index.php/component/weblinks/?task=weblink.go&catid=32&id=5

The wrong code:
*	Can not find Weblinks Category ID (catid), so catid has empty Varible.
*	Variable id (Link ID) contains wrong data, it cointains Weblinks Category ID (catid)

3.	SOLUTION
------------------------------------------------------------------------------------------------
3.1	=== Stage 1 of 3 ===
Open file that have error in scripts.
Please one File helper.php, at: http://localhost/modules/mod_weblinks/helper.php
Go to line: 91.

3.2	=== Stage 2 of 3 ===
Change Variable "$item->catslug" into "$item->catid".

3.3	=== Stage 3 of 3 ===
Change Variable "$item->slug" into "$item->id".
(Please look at attached file: "Preview-3.jpg")

Done!
Our Module should run smoothly at the Front-End.

4.	TESTING ENVIRONMENT
------------------------------------------------------------------------------------------------
*	Joomla! 2.5.0 Stable [ Ember ] 24-Jan-2012 14:00 GMT
*	Internet Browser: Chrome 16.0.912.75
*	ApacheFriends XAMPP version 1.7.7
*	Apache 2.2.21
*	MySQL 5.5.16 (Community Server)
*	PHP 5.3.8 (VC9 X86 32bit thread safe) + PEAR

================================================================================================