Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
justintime CreditAttribution: justintime commentedFixed.
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.