backdrop-contrib / examples

Examples for Developers
GNU General Public License v2.0
7 stars 9 forks source link

image_example_colorize_effect() does not use the correct placeholder #25

Closed avpaderno closed 1 year ago

avpaderno commented 1 year ago

image_example_colorize_effect() logs an error message using the following code.

if (!function_exists('imagefilter')) {
  watchdog('image', 'The image %image could not be colorized because the imagefilter() function is not available in this PHP installation.', array('%file' => $image->source));
  return FALSE;
}

The used placeholder is %image but then the '%file' index is provided in the array passed as second argument for watchdog(). The array index should be '%image', or the logged error will literally be The image %image could not be colorized because the imagefilter() function is not available in this PHP installation. where the placeholder is not replaced.

argiepiano commented 1 year ago

Thanks for providing the PR, @kiamlaluno .

It's good practice to link PRs to the main issues by adding the magic words Fixes #XXX in the PR description. It's also a good idea to include a comment here pointing at that PR, as in:

PR #26