AF (and soon APK) allows other modules to add variables to the "author pane" via hook. I initially took the easy route by simply writing the integration myself and included the code in AF/APK. As I get more and more requests to integrate module X, I realized this was a bad approach and am starting the process to get the hooks into the individual contrib modules.

All I need from you is to either drop the attached files into your module directories (remove the .txt that uploading requires) or take the functions out of them and put it in your module files. Both methods work, just choose the one that works best from you. If you aren't willing to do either, please let me know.

For more information, see Adding variables to the author pane

Thanks,

Michelle

Comments

kbahey’s picture

I don't think we need this to be in Userpoints itself.

We are moving this module to be an API, and pushing module-specific integration outside of it.

We plan to take out the rest of stuff (userpoints_basic, workflow-ng, ...etc.)

So, either you add it as a separate module in its own project, or have it as a submodule in userpoints_contrib. Or more simply, why don't you add them into the respective module, with a if (function_exists('userpoints_blah')) ?

I want to mark this as won't fix, but will wait for jredding's input and possible further notes from Michelle too.

jredding’s picture

Michelle,

The attached file is a hook_ so it can be implemented in just about any module. Please correct me if I'm wrong in my assumption it sounds as if
1) There are lots of module that can provide hooks into advanced forum
2) you would rather people hook into your module instead of you hooking into them, as its a more sustainable model for your module. You can't possibly anticipate all the various items need to be put into a forum or profile.

If that's true then its the same model as userpoints ;) so we would rather you hook into us than the other way around. I say we settle it in a wrestling match. How about at Drupalcon D.C! ;) ha ha..

OK down to business. I had a vision to separate out UI elements from the core API and this might fall in perfectly. its a small piece of code and most likely won't get that much bigger. So we can make this a part of the UI module and leave it out of the core module. This is particularly nice since the same hook works for both advanced forum and advanced profile.

or in less words... we'll figure out what to do with it.

michelle’s picture

@jredding - That's exactly right. Because AF is a "container" of sorts for lots of little contrib modules, I get people asking if I can integrate module x, y, and z. When I started out, I didn't want to bother a bunch of maintainers with my module so I just wrote the code and put it in AF. But now that AF has grown and keeps getting more and more popular the users aren't happy with just the set of modules I happen to use. LOL! Since it's set up as a hook, anyway, I decided it made more sense to push the contrib integration back into the contribs. I will make sure the hook always stays the same so the only thing each maintainer has to worry about is making sure their code keeps up with thier module rather than me having to keep up with 20 modules.

Another reason for this was APK. I'm in the process of rewriting it, now, and decided to make it use the same system AF does since it has a similar author pane in it. That way this one hook will work for both modules. If I keep the integrations in AF, then AF becomes a dependency for APK which most people will find unacceptable.

Of course, I can't force any maintainer to add this. If someone flat out refuses I then have to decide if I want to keep the integration in AF or just drop it. Userpoints is important to me so I'll keep it if you don't want to but it sounds like you have an idea. :)

Thanks,

Michelle

jredding’s picture

Can we still wrestle at Drupalcon?

Thanks for the followup, I think there is some mutual benefit here so we'll come up with a plan.

michelle’s picture

I expect I'll be able to make it to a Drupalcon in about 4 years. If you still want to wrestle, then, you're on. :)

Michelle

jredding’s picture

What if there were daycare/nursery options at Drupalcon? Maybe there are other like you and we can pools things together? Not to drag on this thread just want to get more peeps out by breaking down possible barriers.

michelle’s picture

Anything further on this? Would be nice to not have to tell users to add a file if they want their points showing in the forums...

Michelle

jredding’s picture

If has not be done yet as I'm still working on getting 6 out into stable. Give me until this weekend and then ping me.

kbahey’s picture

Michelle

I still don't see why this should be part of userpoints. We are trying to cut away integration pieces into their own modules. So userpoints basic will be spun off on its own, and so will the rest of the modules. The API will just be an API.

So, the logical place for them would be in a directory under your project, called userpoints, with a README.txt with instructions on how to use them.

michelle’s picture

Why should it be part of AF & APK? I'm not adding anything to userpoints; userpoints is adding something to AF&APK. Plus, if I include this in my modules then I have to have conditionals in there to avoid problems if people run both APK and AF because then the function userpoints_author_pane would be there twice.

Bottom line is that I'm not going to include functions for other contrib modules. If you don't to add userpoints functionality to AF & APK, that's your decision. It just means people will need to keep hacking your module to make it work with AF & APK.

Michelle

jredding’s picture

eh, its only a hook. At the very least we can include it as part of the contrib modules, since people generally get both packages anyhow.

kbahey’s picture

That is what I meant. Provide the integration as a separate module, or as part of your own project.

See examples in userpoints_contrib. Yours can be one of those, or can be a separate project that depends on both AF and UP.

Saying we don't want it in the API does not mean we don't want it ever. It just says it is not part of the API, and can be elsewhere.

michelle’s picture

Status: Active » Closed (won't fix)

Request withdrawn. I have taken the unfortunate step of creating a new project to service my modules since I was unable to get any cooperation from most of the maintainers who's modules I'm trying to make work with mine.

Michelle

kbahey’s picture

Michelle

Please understand that we are trying remove stuff from the Userpoints module and evolve it into an API only.

This applies to your module and others too, and it is taking time.

Your module's integration with userpoints can

1. Live in the http://drupal.org/project/userpoints_contrib set of modules,
2. Be its own integration module (see the Other modules section on that last link), or
3. Live with the original module.

Those are your options, pick any of them. It is not hard ...

michelle’s picture

None of the above. I've withdrawn my request. I've spent two months trying to get just a few measly lines of code committed in 7 different modules. I guess it's too much to ask people to use the preprocess system. I'll just do it myself.

Michelle

kbahey’s picture

I don't see why you would not create a module that has a dependency on yours and on userpoints and include it in a contrib directory with your project.

This way the module could not be enabled without userpoints being enabled, and you keep updating it as/when you wish.

Voting API integrations works that way, in a module that is separate from either userpoints or voting API. Other modules do the same.

But, you seem to have made up your mind, so whatever works best for you.

michelle’s picture

So I'm supposed to make two modules, one for each project, that do nothing but implement a hook that belongs in your module? And then I have to make sure the user doesn't enable them both at the same time because of namespace collisions. And I'm supposed to do this for the 6 other modules that can't be bothered to add the preprocess code as well? That makes even less sense than the route I took.

So don't worry about it. I'll chase your API along with everyone else's because I guess it's unreasonable to ask modules that want to add data to AF & APK to keep their own hook in their own modules. So much for the preprocess system.

Michelle

kbahey’s picture

I can't talk for other modules.

But the same argument you have made from your project's point of view can be made the other way : are we supposed to include modules/includes for everything that needs userpoints integration?

Initially, we did that, all in the contrib directory with a directory for each module. Then we found that as people contributed stuff and went missing in action, we were left with code that we did not write and cannot keep up with and maintain in the long term with only a couple of active maintainers.

So we started splitting stuff off in userpoints_contrib. We are taking that further in the future by splitting off Userpoints Basic, Workflow/Rules integration and the rest of the stuff. Others have taken the correct path by creating projects for their integration.

Views did this with splitting the "bonus pack" modules into their own modules. We will do this with Rules/Basic and the rest of the non-API. Voting API does not include any voting applications and leaves that to other projects like vote up/down, five star, ...etc.

This is what I encourage you to do: either create a new project for integrating with each module or one "integration pack" project with all of them. If it is too much work (and it probably is for a one person maintainer team), then try to find if some of those who like your module and want to integrate it with other modules rather than you ending up with "owning" everything and having to take it forward through release and API changes.

michelle’s picture

It doesn't go the other way, though, because I'm not asking you to put an API call to AF & APK in your module. This is a preprocess hook. The code I'm asking you to add is "USERPOINTS_preprocess_author_pane". The code in the function is all USERPOINTS api calls. All I am asking you to maintain is your own code so that I don't have to keep up with changes to your API and so that I don't have to try and duplicate your module's hook implementation in two different projects.

Or I was. It's a moot point, now. I won't fixed this issue because it's pointless to keep arguing about this. I moved the author pane to its own project so I can safely implement the preprocess hooks for all the modules that won't do it. Of course, any module is still free to use the preprocess system properly if they want to add to AF & APK but I've decided to take on the responsibiliy of doing it myself for the modules I use rather than having to continue explaining toconfused users that they need to add code to each of these modules if they want the modules' data to show up in AF & APK.

Michelle