?
avatar dbclkclk
dbclkclk
5 Mar 2016

Steps to reproduce the issue

  • Installed custom component in 3.x
  • Create method in component to return JSON:

    public function checkusernameavailability()
    {
    
    
        try {
                if($username = JRequest::getVar("username","","get","cmd"))
                {
                   $db = JFactory::getDbo();
    
                   $query = $db->getQuery(true);
    
                   $query->select($db->quoteName("id"))->where($db->quoteName("username")."=".$username);            
    
                   $db->setQuery($query);
    
                   $result = $db->loadObjectList();
    
                   if(!$result)
                   {  
                       throw new Exception($username.JText::_( 'COM_USERS_PROFILE_USERNAME_MESSAGE' ));
                   }
                }
                else
                {
                    throw new Exception("");
                }
        } 
        catch (Exception $ex) 
        {
            echo new JResponseJson($ex);
        }
        echo new JResponseJson(true);
    }
    
  • Make a request that looks like this: http://localhost/site/index.php/option=com_component&task=parents.checkusernameavailability

Expected result

return JSON with either 200 or 500 error

Actual result

Save for brevity <html lang="en-gb" dir="ltr"
class='com_content view-article itemid-444 j34 mm-hover'>............................<small>Sorry! The page you are looking for</small><br> Not Found
This result is within'

System information (as much as possible)

Joomla 3.4

Additional comments

avatar dbclkclk dbclkclk - open - 5 Mar 2016
avatar brianteeman brianteeman - change - 6 Mar 2016
Labels Added: ?
avatar brianteeman brianteeman - close - 6 Mar 2016
avatar brianteeman brianteeman - change - 6 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-06 11:39:39
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 6 Mar 2016

Please use the mailing list to discuss issues with your custom component
https://groups.google.com/forum/#!forum/joomla-dev-general


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9313.

avatar brianteeman brianteeman - close - 6 Mar 2016

Add a Comment

Login with GitHub to post a comment