API functions are supposed to be called internally. We should not print debug messages, because user running these functions is a site visitor, and not always a privileged user. Printing debug messages to site visitors only confuses them. All debug messages are supposed to be logged into watchdog only, and if there's an error in the UI, it's good idea to print debug messages outside of the API call, when you are sure you have proper user to read them.
I only found this once in the node_gallery_get_image_nids() but there could be more places to fix.

Comments

justintime’s picture

Status: Active » Fixed

Fixed.

I added a watchdog, but I also added a condition around the drupal_set_message() to check that the user has 'administer node gallery' privs. Best of both worlds IMO.

Status: Fixed » Closed (fixed)

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