Closed (fixed)
Project:
Flickr
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2007 at 17:02 UTC
Updated:
5 May 2007 at 03:00 UTC
My NSID was continually blank after filling in my flickr username while editing my user.
Two things I noticed:
1) the "isset" checks on $account->flickr['nsid'] return TRUE if the field is ""; these checks chould be changed to "!empty" or "isset" should just be removed
2) currently $account->flickr['nsid'] is being set in the validate part of hook_user. This value is overwritten from the database by the time hook_user gets to insert/update. validate should just check the validity of the flickr username. Set the variable $nsid when doing the insert/update.
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| flickr-nsid-set.patch | 2.38 KB | samo |
Comments
Comment #1
andrewlevine commented1. I've talked about something like this with drewish. Are there any implications of accessing an array key of an array that may not exist outside of an isset statement?
2. good catch.
Comment #2
andrewlevine commentedCan you explain when/why the value is overwritten? It works fine on my end. The reason the NSID is retrieved in validation is because we need to check it so if the user enters an invalid identifier, they are notified. The value is saved in hook_validate so we don't have to make the same API call twice.
If the value is somehow overwritten I would definitely like to fix the bug.
Comment #3
drewish commentedwhoops, didn't see this issue. i committed a similar fix for this last week.
Comment #4
(not verified) commented