The following fatal error appears when attempting to display the front page after implementing gravatar:
Fatal error: Call to a member function getDirectoryPath() on a non-object in /modules/image/image.module on line 809
I am using the Corolla theme. The same error occurs after switching to the Bartik theme. I am using D7 Beta 1.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | external_user_picture.patch | 2 KB | chx |
| #22 | external_user_picture.patch | 1.96 KB | chx |
| #21 | external.user_.picture.patch | 2.33 KB | Anonymous (not verified) |
| #15 | drupal-937562-15.patch | 2.01 KB | tim.plunkett |
| #14 | drupal-937562-14.patch | 1.96 KB | tim.plunkett |
Comments
Comment #1
sivaji_ganesh_jojodae commentedI can reproduce the same in drupal 7 beta 1 without
Gravatar integrationmodule.To reproduce, set "Default picture" field in
admin/config/people/accountsto http://images.adbard.net/sites/default/files/audience_1.png or similar and access node page. The site will be totally broken now.Comment #2
sivaji_ganesh_jojodae commentedComment #3
swentel commentedCan confirm, somewhere in template_preprocess_user_picture() the $filepath isn't in the right format to make sure file API knows where to get the picture. On top of that, the comments above are pretty confusing also imho :).
Comment #4
Nikdilis commentedConfirmed!
Comment #5
swentel commentedOk, a workaround to make this work is 'simple'. If the avatar is in your public files directory (sites/default/files) and you enter
everything will be fine. Maybe we should add a validate to this field to really find out if the URI entered is valid and give some guidance how to enter a value in this field, or on validate convert it to a URI which can be read by the stream wrapper.
Comment #6
tim.plunkettimage_style_url()assumes a local file. You can't put in anything that has http:// in that field. Is that a regression? I can't think of anywhere else that lets you enter in an external url like that.Comment #7
dave reidThis is a regression. It was perfectly valid to allow an external URL.
Comment #8
tim.plunkettAdded a check to
url_is_external()so that image styles aren't loaded.Comment #9
damien tournoud commentedfile_stream_wrapper_valid_scheme(file_uri_scheme($filepath))feels more appropriate here.Comment #10
damien tournoud commentedOr better yet,
file_valid_uri()which is basically a wrapper around this.Comment #11
tim.plunkett+1 for using the API properly.
Comment #12
webchickLet's get a test for this.
Comment #13
tim.plunkettWorking on a comment and a test right now.
Comment #14
tim.plunkettFirst attempt at writing tests. Fails without the change, passes with it. Sounds right to me?
Comment #15
tim.plunkettThanks chx and davereid.
Comment #16
zkday commented#15: drupal-937562-15.patch queued for re-testing.
Comment #17
tim.plunkettUh, thanks for the retest?
Anyway, justinrandell raised concerns about using druplicon.png for the tests, since it could theoretically someday be used on /user. I used druplicon.png at chx's suggestion, and it's also used in other tests.
He suggested using $this->drupalGetTestFiles('image') and getLocalPath(), but that wouldn't work because that isn't an absolute or external URL. He also said "i'm not going to stop this patch if you leave it as is".
So where does that put us?
Comment #18
Anonymous (not verified) commentedok, so, to not leave this hanging, i think its ready to go, so RTBC.
as to my comments in #drupal - i'm generally opposed to using images other than those provided by simpletest for exactly these sorts of tests if we can avoid it. anything that can legitimately be used in a normal install opens up the possibility of breakage if we make a totally unrelated change somewhere else.
and, yeah, i got the getLocalPath() bit totally wrong, a call to getExternalUrl() should be used instead.
Comment #19
chx commentedThat druplicon image is there approx since Drupal 1 :) I am not worried. We do not use its dimensions either.
Comment #20
chx commentedAfter further discussion let's fix it rather. Use a simpletest image and xpath to ensure it's on the page because it's a user picture.
Comment #21
Anonymous (not verified) commentedok, patch attached that uses a test image and xpath to check the image source.
Comment #22
chx commentedassertTrue == should be assertEqual and simpletest attributes() method is not needed if you know the name of the attribute -- just use the array syntax, just dont forget to cast to string as well.
Comment #23
tim.plunkettThanks for fixing it while I slept. :)
Comment #24
webchickAwesome! A few minor nitpicks and then this is good to go:
Why would this happen? Could you add an example? It's not clear from the code.
This is non-standard PHPDoc. Should just be one short sentence description that is < 80 chars.
Let's get a comment summary at the top of this hunk, like you have down below, to explain what's happening.
Comment #25
chx commentedDone all three despite the test class is already full of this "non-standard" PHPDoc.
Comment #26
dries commentedCommitted to CVS HEAD. Thanks.