I needed this module for D6 so I took a shot at updating it. It seems to be working fine. I ran it through coder and cleaned it up.

Coder is giving me the following message on lines 45 and 73 and I'm not sure what, if anything, needs to be done:

In SQL strings, Use db_query() placeholders in place of variables. This is a protential source of SQL injection attacks when the variable can come from user data.

So far everything looks good....

Comments

WorldFallz’s picture

I forgot to say that it's not in patch form... I wasn't sure how to do that for a whole module, so I just attached the whole archive.

moshe weitzman’s picture

there is a new $node->build_mode that this module can probably take advantage of in D6. A straight port might be less than ideal.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Actually, this patch is just fine. I tested it and code reviewed it and it is committable IMO. Sure more could be done, but that would go beyond a straight port. Lets leave those for other issues.

I noticed a little cruft at the end of premium.info which can be easily deleted before commit. It is harmless though.

moshe weitzman’s picture

That coder warning refers to the query where we inject the current timestamp. The current timestamp is always an integer and isn't user-provided content so the coder message is spurious in this case.

Chill35’s picture

I am keeping an eye on this.

Thank you for the port, WorldFallz.

Any improvement can be made into an issue after that's committed.

jerdavis’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new10.98 KB

In order to make things easier for a Drupal 6 upgrade, I've created a CVS diff patch based on the current Premium CVS HEAD branch. I've done some extensive testing on this end, and everything seems good. This was against Drupal 6.2.

Creating a patch from a CVS diff is really highly preferable to a re-write and full tarball of all module files. It makes it much easier for the project maintainer, and really isn't very difficult to do. There's some great information available here on Drupal.org at http://drupal.org/patch/create and http://drupal.org/node/120511.

Thanks!

Jer

salvis’s picture

Status: Needs review » Needs work

Congratulations for getting your seat, Jer!

With the commits at the beginning of August, this is obsolete.

Can you give an indication of when a D6 version might become available?

webdevbyjoss’s picture

Hello, I'm interested in Premium module to be available for D6 so I can contribute some code, testing, etc for this module.

As I understand I can get an HEAD revision in order to get the latest Drupal 6 module code. Can you please assist?

jeremdow’s picture

Hi, I rerolled this patch (actually I used Deadwood, just left a couple things to clean up on the installer and menu hook) - tested on Drupal 6.4 and running on my site - everything seems fine.

Thanks for a great module!

Jere

jeremdow’s picture

Status: Needs work » Needs review

Anyone want to test this - Jer, Moshe?

I'd really like to see a supported D6 port of this module - this seems to be a good way to get that right away, as Moshe said.

Jere

salvis’s picture

Status: Needs review » Needs work

Thank you for picking this up — a few comments:

  1. You dropped the primary key.
  2. In
     function premium_nodeapi(&$node, $op, $teaser) {
       $node->premium = _premium_node($node);
    -  $node->premium_access = _premium_access($node, $teaser);
    +  $node->premium_access = _premium_access($node, $teaser, $account);
    

    where does your $account come from?

  3. In
    -    if (is_bool($access = $function($user, $node))) {
    +    if (is_bool($function($account, $node))) {
           return $access;
    

    you stopped setting $access but you're still returning it.

jeremdow’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB
new1.61 KB

Thanks - new patches attached - on your points -

1. Added the primary key back to 'nid' in the schema.

2. You're right, no need to pass $account through these functions at all - reverted to the original.

3. Not sure how this got in there - I'm not using any other modules hooking _premium_access - but reverted to the original - this is a short patch now.

Jere

salvis’s picture

Status: Needs review » Needs work

It does look too short now, indeed.

If you go from

function _premium_node_operations_premium($nids, $premium = 0) {

to

function _premium_node_operations_premium(&$form_state, $nids, $premium = 0) {

... — where is the caller of that function? How does the caller know that he's suddenly supposed to pass an additional first argument?

Did you run this through Coder to check for other porting issues?

webdevbyjoss’s picture

Thanks!

chrysonline’s picture

hi,

it's difficult for me to patch. (i used patch software for windows like patch, tortoise, eclipse.. with no result).

Can you give the lastest version of Premium module for Drupal 6.x in attachment (i use D6.6) ?

Thanks!

adamcarsonb’s picture

I would also like t try the 6.x rev version. Care to post a tarball? I'll let you know how it worked for me this week.

xrundel’s picture

Hello all.

Great module. Sorry for the question, but could you please tell me if this module ready to install to 6.x?

adam_b’s picture

subscribe

djbdjb’s picture

subscribing

pepemty’s picture

subscribing

bakyildiz’s picture

subscribe

kjay’s picture

subscribe

DaraghOB’s picture

Has this been committed yet as a D6 module? It's not listed on drupal.org/project/premium. I really need to have it for a project I'm working on and (for a variety of reasons) patching the D5 module isn't an option for me.

I'll go with the current dev tarball unless there is a better option.

jerdavis’s picture

Status: Needs work » Fixed

HEAD updated to D6 and branch created - snapshot should be up soon!

DaraghOB’s picture

Once it is up I'll install on my Dev site and do a quick test.

Status: Fixed » Closed (fixed)

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

JStarcher’s picture

Any updates? Should I use the unsupported from the HEAD?

micheleannj’s picture

subscribing

espirates’s picture

subscribing