Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2011 at 13:38 UTC
Updated:
8 Sep 2011 at 14:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
aaron commentedthis all looks right. except i think you should use !isset() rather than == NULL... the attached patch does that.
Comment #2
aaron commentedrtbc, assuming it passes the test...
Comment #3
pp commentedok, but i think we should use is_null() rather than !isset(). The $params variable always exists. We shouldn't test the $params variable exist or not (isset), We sould test the $params variable is null or not. (is_null, isset)
Comment #4
dave reid!isset() is always preferred over is_null()
Comment #5
pp commentedWhy? Is it a Drupal wodo?
Comment #6
pp commentedIsset is faster.
Comment #7
aaron commentedyes, !isset() is faster, and doesn't throw an error if passed a variable that hasn't yet been set. the only place where is_null() might be preferred is if passing in a function call, which is bad practice anyway.
Comment #8
idflood commentedI have no doubt in the first point exposed in #1. But the second about $stored_params seems a bit wrong to me. At least, the solution provided in #1245430: media_set_browser_params should use reference of $params looks more coherent.
Here is a patch with a mix of both solution. I don't know how to test this manually though.
Comment #9
idflood commentedComment #10
dave reidI think this is actually the more proper solution:
Comment #11
pp commented#10 It is the best solution.
Comment #12
dave reidCommitted #10 to both 7.x-2.x and 7.x-1.x.
http://drupalcode.org/project/media.git/commit/fda6f10
http://drupalcode.org/project/media.git/commit/1cda239