Closed (fixed)
Project:
Flickr
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
14 Apr 2007 at 17:44 UTC
Updated:
1 May 2007 at 05:16 UTC
Jump to comment: Most recent file
In this patch:
1. added/modified a couple functions to flickr.inc and flickr.module that were being rewritten over and over in all the different modules.
2. made flickr_block.module use our API instead of flickr_request.
I still need to look at flickr_filter, flickr_sets and flickr_tags to make sure the code is clean in those.
PLEASE TEST, BECAUSE I DIDN'T HAVE TIME TO :0
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | flickr_136317_0.patch | 12.87 KB | drewish |
| #12 | flickr_136317.patch | 11.49 KB | drewish |
| #10 | flickr_use_api_0_1.txt | 12.12 KB | andrewlevine |
| #8 | flickr_use_api_0_0.txt | 11 KB | andrewlevine |
| #3 | flickr_use_api_0.txt | 8.4 KB | andrewlevine |
Comments
Comment #1
drewish commentedi don't know what you mean about flickr_tags and flickr_sets... they're not in CVS...
you're calling flickr_get_photos() but it's not defined anywhere.
so don't go committing anything you don't have time to test, that's how i got us such a nice queue full of issues ;)
as part of this issue, i'd like to rename flickr_error() to flickr_request_has_error() or something more descriptive.
Comment #2
drewish commentedalso as per the drupal coding style, you need to put spaces around = and =>.
Comment #3
andrewlevine commentedThose are 2 modules that I wrote and submitted patches for. They were never committed and are out of date now, but IMHO when I get them working again they should be committed so we can get some testing from the community.
sorry to waste your time, I just wanted to get it in the queue in case I had no time to get back to it.
OK so the newest patch:
Oh...and I checked flickr_filter and didn't find any API stuff that needed changing.
Comment #4
drewish commentedgotcha on those other two modules, for some reason i thought they'd been committed. don't worry about time wasting, it's good to see improvements.
i guess it was existing code that had missing spaces around ='s.
i'm not sure how i feel about having the userid parsing code in flickr_photos_get(), it seems like it should be in a separate function since we'll need it several places. we should always pass a nsid to flickr_photos_get().
one thing i did notice that's not related to this patch is flickr_photos_get(). i don't really like the way it takes tags as a separate parameter. it seems to me it'd be better if all that went through a single arguments array.
Comment #5
andrewlevine commentedI actually agreed with you on that point 2 months ago...dejavu : http://drupal.org/node/116533
Let's get that committed and I'll rework this one.
The reason it takes tags as a separate array is so you don't have to worry about the flickr tags input syntax and implode them yourself. I personally don't care one way or another so I'll change that if you want.
Comment #6
drewish commentedsweet. i jsut committed that other patch. there's still some wonk but it was a good move in the right direction. i'd be into moving that tag exploding code out to the caller. if it gets used in multiple places then we can make it into a helper function.
Comment #7
andrewlevine commentedSince we're moving so much code out of flickr_photos_get, I think we should turn it into a regularish flickr API call wrapper (flickr_photos_search in flickr.inc).
It would be something like this:
What do you think?
Comment #8
andrewlevine commentedI really like how this patch is shaping up. I think it's RTBC now. Here is a list of everything this patch does:
Comment #9
drewish commentedi agree, this is looking like a really good set of changes.
reading the code i realized that flickr_request_has_error() should be flickr_response_has_error() because we're checking the result not the request. how about simplifying it to:
i wouldn't remove theme_flickr_filter_photoset() unless you also remove theme_flickr_filter_photo(). i think they should be able to override the filter theme functions separately from the regular photo theme functions. maybe it'd make sense to just have them pass the call along to theme_flickr_photoset_preview and theme_flickr_photo so there's a default implementation.
also, what are your thoughts on my comment on #136542 in terms of checking for errors and returning the relevant array member in our API wrapper functions?
Comment #10
andrewlevine commentedI changed the name and simplified the function. Please make sure to check its logic because unless I'm more tired than I think I am, the logic in your snippet is incorrect.
Agreed, it's in the new patch.
Yes. But lets get this patch committed first since it is getting big.
Comment #11
drewish commentedhehe, you're right. i'd dropped the !
i remove the _preview from the photoset theme functions. since we pass in the full photoset they can theme it how ever they like. i also removed some parameters that were never being passed in.
if you're happy with this then lets commit it. as you said there's plenty of other stuff we need to get in once this is done.
Comment #12
drewish commentedoh, here's my patch
Comment #13
andrewlevine commentedThis function really doesn't like you, I think you meant this:
Can you re-roll and then I will test and commit?
Comment #14
drewish commenteddoh. well here's a re-roll. i was using the flickr filter to do the testing and realized that the messages could use a little cleaning. we'll end up deleting them in the next set of changes but at least they'll be right until then.
Comment #15
andrewlevine commentedcommitted! i'll open another issue for the wrapper function changes we're making.
Comment #16
(not verified) commented