bugGNU FM - Bugs: bug #26651, error when trying to access...

 
 

bug #26651: error when trying to access profile that doesnot exist

Submitted by:  Ankur Shrivastava <ankurs>
Submitted on:  Sat 23 May 2009 07:08:59 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 03 Jun 2009 07:59:40 PM UTC, comment #2:

Fixed on dev.

Jørgen Bøhnsdalen <jurgbohn>
Project Member
Mon 25 May 2009 10:02:58 AM UTC, comment #1:

I reckon the attached patch should fix this.

Not tested I'm afraid as I haven't been able to get my own instance of libre.fm working yet.

While it's probably better to handle non-existent users with exceptions, the code doesn't appear to handle this anywhere yet. This solution should work as pages which instantiate User() check for the existence of $user->name to confirm that the user exists.

(file #18198)

David Johnson <dj1471>
Sat 23 May 2009 07:08:59 PM UTC, original submission:

Shows error when trying to access an non existing user like http://alpha.libre.fm/user/abcxyz

Fatal error: Uncaught exception 'Exception' with message 'ERROR SELECT * FROM Users WHERE lower(username) = 'abcxyz'' in /home/librefm/web/data/User.php:58 Stack trace: #0 /home/librefm/web/user-profile.php(35): User->__construct('abcxyz') #1 {main} thrown in /home/librefm/web/data/User.php on line 58

Ankur Shrivastava <ankurs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jurgbohn (Posted a comment)
  • -unavailable- added by dj1471 (Updated the item)
  • -unavailable- added by ankurs (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 03 Jun 2009 07:59:40 PM UTCjurgbohnStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 25 May 2009 10:02:58 AM UTCdj1471Attached File-=>Added fix-invalid-user-exception.patch, #18198

    Back to the top


    Powered by Savane 3.1-cleanup1