Fix Bug: could not select the category id in the menu item type (basic) + fix query to fetch related categories

tested on joomla 3.2.3