API page: http://api.drupal.org/api/drupal/modules!image!image.module/function/the...

Can we please update this documentation to clearly state the type of path expected by this function? From the documentation it seems like the path is supposed to be a relative path in the form of /sites/default/files/my_image.jpg

However, this function accepts URIs now in the form of public://my_image.jpg

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Novice, +Needs backport to D7

It looks like it should accept either, but probably you can't start your path with /sites (should be just sites without the leading slash). I agree that the documentation should be updated. It also applies to Drupal 8 (it's called 'uri' not 'path' in Drupal 8 but it does the same thing).

Needs a patch... possibly a good Novice project?

damiankloip’s picture

FileSize
871 bytes

Something like this maybe?

damiankloip’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Thanks! The text in the patch looks good to me. But the addition is making the line longer than 80 characters, so it needs to be wrapped.

damiankloip’s picture

Status: Needs work » Needs review
FileSize
877 bytes

Here we go, this has fixed that :)

jhodgdon’s picture

Status: Needs review » Needs work

Not quite! Just make the wrapped line go all the way to the left (indented the same as the rest of the @param section).

jhodgdon’s picture

By the way, here are the documentation standards:
http://drupal.org/node/1354

damiankloip’s picture

Status: Needs work » Needs review
FileSize
991 bytes

hehe, ok. I think I see what you mean with the indentation. How about this??

jhodgdon’s picture

Status: Needs review » Needs work

Um, not quite. Just leave the existing lines as they were, and indent the new ones the same as the old ones. :)

damiankloip’s picture

FileSize
879 bytes

:) Don't worry, I *WILL* get this....

I think I see the issue with the second patch (which was closer) now that I didn't notice before I posted it!

damiankloip’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

There you go! :) Don't worry, I'm (hopefully) patient with new contributors. I'll get this committed to 8.x shortly. We will also need a patch for 7.x, which is the same except for the argument name being different (I think?).

damiankloip’s picture

Yay! good news. I am definitely new to the core contributions category! been doing all of my work in the contrib space. I will look at a D7 patch shortly...

damiankloip’s picture

FileSize
860 bytes

Yep, I think the only difference is that the key is called 'path' in D7 and 'uri' in D8. Here is a re-rolled patch for D7. Will this fail until issue version tag is changed to D7?

webchick’s picture

Yep. You can name the patch with "do-not-test" in the name (e.g. 1444650-5_d7-do-not-test.patch) to make testbot skip it.

damiankloip’s picture

Ah, clever :) I did not know that.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1444650-5_d7.patch, failed testing.

damiankloip’s picture

Status: Needs work » Reviewed & tested by the community
jhodgdon’s picture

Title: Make the path argument documentation more clear in theme_image_style for D7 » Make the path/uri argument documentation more clear in theme_image_style
Status: Reviewed & tested by the community » Fixed

Committed to 8.x and 7.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.