Node User
Drupal 6.x
Project Page: http://drupal.org/sandbox/amorsent/1935480
git clone --branch 6.x-1.x http://git.drupal.org/sandbox/amorsent/1935480.git node_user

Reviews of Other Projects

http://drupal.org/node/1934104#comment-7147198

Module Description

Node User is intended to allow nodes to act as users. It does this by creating a user for each node. This functionality can be configured by node type.

This module differs from Content Profile. Content profile is designed to extend a user profile with content from a node. Node User on the other hand is intended to extend a node with a user. The node can still be authored by a different user, and indeed, this is kind of the point.

The practical example for this module would be something like Facebook's "Pages". A Facebook "Page" is not the same thing as a user, but it can ACT as a user, making posts, commenting and voting on things, etc.

Node user lays the foundation of maintaining the node-user relationship. It also provides views relationships linking the users and nodes.

Future developments may include:

  • A switch user interface to allow users to "Act As" one of their node users.
  • Tighter integration with core and common contrib modules
    • Comments
    • Voting API
    • User Points
    • insert your sugestion here
CommentFileSizeAuthor
#7 node_user_1.PNG21.86 KBteyser

Comments

davidsonjames’s picture

Status: Active » Needs work

Hello, please try to fix issues raised by automated review tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxamorsent1935480git-6x-1x

amorsent’s picture

So PAReview is more strict than Coder - even in strict mode - wow!

Anyway, I've taken care of almost all of the formatting issues that PAReview has indicated. There are a few remaining formatting issues, but I'd like to make a case for my way ;)

PAReview is complaining about things like this:

86 | ERROR | Expected "if (...) {\n"; found "if (...) {"
86 | ERROR | Closing brace must be on a line by itself
183 | ERROR | Inline control structures are not allowed

Mainly it doesn't like what I'll refer as the "Yea… I don't care" structure:

function module_some_hook(){  
  // If I don't care, bounce
  if(!$care) return;
  
  // long bit of code
}

Often I use this as an alternative to something like this:

function module_some_hook(){  
  // If we care, read through this big block of indented code
  // But if we don't care, you're just going to have to
  // look for the closing bracket, because there COULD
  // still something we care about
  if($care){
    // YAY, the whole function is indented one more level!
    if($some_check){
      // some stuff
    }
    if($another_thing){
      // more stuff..
    }
    // More stuff
  }
  // Nope, still don't care.
}

Granted the don't care approach can work with-in the confines of coding standards:

function module_some_hook(){  
  // If I don't care, bounce
  if(!$care){
    // Yes I care, Please oh please tell me what next!
    return;
    // Oh.
  }
  
  // long bit of code
}

But now this simple bounce is 3 times as many lines. In my mind this is a case of following the letter of the law vs the spirit of the law. I tend to feel the non-compliant case here is a little more elegant and readable.

I have slightly compromised and at least wrapped brackets around the return. This at least prevents PAReview from telling me that all remaining lines in a switch/case are indented incorrectly, although it does then complain a little more about the brackets being on one line.

function module_some_hook(){  
  // If I don't care, bounce
  if(!$care) {return;}
  
  // long bit of code
}

So what's the verdict on all that? I'll change it if I must.

PAReview is also complaining about this line because of the control structure. But all I'm doing here is loading up an array.

while ($list[] = db_result($result));

Should I be more verbose and say:

while ($item = db_result($result)){
  $list[] = $item;
}

Again, that just seems overly verbose to me.

Thanks!

amorsent’s picture

Status: Needs work » Needs review
m.stenta’s picture

This is a very cool idea, and the module code looks great to me. Very readable, and easy to follow. All the right hooks and functions are being used. And conceptually it makes sense.

This will be a cool addition to the available Drupal modules... give Facebook a run for their money! ;-)

+1

klausi’s picture

We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and put yourself on the PAReview: review bonus high priority list. Then I'll take a look at your project right away :-)

sreynen’s picture

Title: Node User » [D6] Node User
teyser’s picture

StatusFileSize
new21.86 KB

Hi amorsent,

I installed your sandbox project and I found one issue.Could you please refer the attached image for your reference.

When I create a page content type as node user (anonymous user). User mail id is stored in the DB in wrong format.

Regards,
-Raj.

amorsent’s picture

Thanks Raj,

I have added some extra config on the node-type edit form. This allows you to specify a default email to use when the node author is anonymous. I have tested this and it seems to solve the problem for me.

Thanks again for the feedback.
- Dylan

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

The code style is not really up for debate, Drupal has only 1 way to do it. It's not just your personal preference, the rest of us who work in Drupal find it a lot easier to read code if its all written in the same style. See https://drupal.org/coding-standards for more detail.

The code looks fine though, and that's not a blocking issue.

sreynen’s picture

I wouldn't say the code style isn't up for debate, just that this isn't the place to debate them. https://groups.drupal.org/coding-standards is the place to discuss and change Drupal's coding standards. Most standards are there for good reason, so changing them might be difficult. And until the standards are changed, kscheirer is right that individual contributors are expected to adopt the community coding standards for Drupal.org-hosted projects.

amorsent’s picture

Thank you all. I have made changes to my code to abide by the coding standards. The code is currently passing PAReview with no issues.

This issue has been marked RTBC, but as far as I can tell I haven't been granted the project creation permission. What needs to happen next?

Thanks.

amorsent’s picture

Bump.

This issue has been marked RTBC, but as far as I can tell I haven't been granted the project creation permission. What needs to happen next?

Thanks.

amorsent’s picture

Status: Reviewed & tested by the community » Needs review

Bump again. I'm setting the status back to "needs review" hoping to grab the correct set of eyes.

This issue was previously marked RTBC, but I never received the project creation permission. Would someone in the know please advise me of any additional steps I should be taking.

Thanks.

kscheirer’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

This should stay in RTBC. There is no further action required on your part, now it's just waiting for final approval. You can bump the priority to try and get more attention.

amorsent’s picture

Thank you kscheirer. It was marked RTBC a month ago. Do you know how long it usually takes for final approval?

kscheirer’s picture

I don't know for sure, there's not an official timeline. The best thing you can do is get a Review Bonus by reviewing other applications. That will get you to the top of the list of projects to get reviewed (and hopefully approved). See https://drupal.org/project/projectapplications#review_bonus.

----
Top Shelf Modules - Enterprise modules from the community for the community.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

It has been a while, code passes ventral.org cleanly.

Thanks for your contribution, amorsent!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

amorsent’s picture

Thank you all.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Adding other module review link