Hi,

thanks for this module. Could you make the $node parameter for the function buymeabeer_paypal_link() optional, so a block can be used on none node pages? A quick glance into this function shows, that there is a fallback anyway and the node object is only used to retrieve a user id in case user specific donation emails are set.

I would simply like to show a block on every page of a site, pointing to the same, globally defined paypal account.
For my use case it is sufficient to change
function buymeabeer_paypal_link($node) {
to
function buymeabeer_paypal_link($node = NULL) {

An alternative would be to be able to give the user id or an account object as a parameter, but not the node.

Comments

d34dman’s picture

hii berliner, must confess i quite do not understand your requirement. Where would the email id come from to generate the paypal link?

berliner’s picture

Hi,

sorry, that I forgot to respond. I just found this issue on my dashboard.
I don't really need this anymore, but the general requirement was to just drop the required node argument when calling the function buymeabeer_paypal_link(). As far as I understood your modules code this wouldn't require any other code changes. The email could come from a globally defined email setting, either as an option in your module or simply the from global site configuration.

Hope that clarifies it. As I remember the scenario right, this feature would be useful on pages with very limited or no registered user to propose a general donation option for the whole page.

best regards,
berliner

yaph’s picture

Currently there is no block hook, I think that is what would need to be added, but if it's not needed any more, it should be okay the way it is.

berliner’s picture

nevermind, thanks for looking into this

berliner’s picture

Status: Active » Closed (works as designed)

closing the issue