I am beginning some development in pollfield and took a first look at the code using the coder module. I notice that there are some trivial things that still need to be done to make the pollfield module conform to the Drupal 6 code standards. Would the primary developers be open to a patch that addresses these issues (mostly spaces and indentation)? This is such a great module and I'd just like to clean up the back end a bit.

Comments

vm’s picture

There should be no reason those patches don't get in to help this module conform and pass coder.module recommendations.

mario_prkos’s picture

@Bryan
This is good idea! I planed to do this but I had been busy with fixes and new features. I will be glad to see this done. I recommended that you try with dev version. I also planning next big step in developing this module so if you have any developing planing or ideas please share with us.

Road map is something like this:

  1. there were user's request for additional infos to be stored with pollfield for example name and email
  2. implementing charts as view results option (openflash, flot, google charts)
  3. add new choice button if additional choice is required
bryan kennedy’s picture

OK, I am working on the dev branch. However, as far as I could tell it is identical to the latest beta version except for the .info file. Let me know if there is an even newer version of the dev branch. I will submit a patch for the code standard changes later today.

mario_prkos’s picture

Great, looking forward to see it!
At the end of the week I am releasing recommended version from dev branch so they are basically the same in the beginning of the week.

bryan kennedy’s picture

Issue tags: +Coding standards
StatusFileSize
new93.68 KB
new4.59 KB

Here are the patches to bring the pollfield into the Drupal code standards. It's a fairly massive patch because of the changes needed to address indentation and whitespace issues. I made all the recommended coder and coder tough love changes, mostly by hand. So hopefully there aren't any bugs as a result of script based changes. Here's an overview of what I changed:

  • tabs to 2-spaces
  • fixed indentation to follow logic
  • added spaces around all operators ($var='hello' is now $var = 'hello' )
  • changed string concatenation to Drupal 6 standards
  • removed any trailing whitespace
  • put spaces in the correct spaces around curly braces
  • aligned conditional statement layout with D6 standards
  • expanded some doxygen comments to fit standard
  • normalized the use of single and double quotes (tried to get it to where double quotes were only used in SQL and inside HTML strings)
  • Made, true, false, and null UPPERCASE

I tried to avoid any logic changes that could affect the operation of the module so that this patch would be simpler to trouble shoot if any bugs arise. It tests out OK on my local install of D6. I can add the pollfield type modify its features in various ways and vote on polls alright. Let me know if you need any more clarification on the changes I've added into the patch.

vm’s picture

Status: Active » Needs review
bryan kennedy’s picture

StatusFileSize
new2.25 KB

Woops, I had something go wrong when I created the pollfield .install.patch file. That one is not correct. Please refer to this patch for the install profile.

mario_prkos’s picture

@Bryan

Thanks! You did it a good job. I will posted this in dev version soon as possible.

bryan kennedy’s picture

Status: Needs review » Reviewed & tested by the community

Cool, let me know if there is anything I can do to help.

mario_prkos’s picture

Look at http://drupal.org/node/589210 (my last post) if you are willing to help testing live pollfield. Especially for user anonymous voting policy. I really want this stuff working good and I want to clean as many issues as possible before proceed with next step.

bryan kennedy’s picture

Status: Reviewed & tested by the community » Needs work

@mario_prkos - Looks like you implemented some of the patch changes into your new version, but not all of them. Thanks for that.

What would be the best way to proceed from here to get the module into compliance with the code guidelines? Should I roll a new patch against the 6.x-1.10-beta1 version?

vm’s picture

likely against 6.x-dev unless HEAD is still 6.x and hasn't shifted to 7.x

bryan kennedy’s picture

Yes, I will do it against 6.x-dev for sure...I was just trying to specify the new version of 6.x-dev. It seems like mario is keeping dev and the latest version pretty much exactly the same for now.

mario_prkos’s picture

@bryan, it will be great.You can use 1.10-beta1. I rolled patches but you right some of them didn't pass. I used dev version. Now dev version and recommended are the same. I will than sync them after patch is rolled on 1.10-beta1.

Thanks for help, Mario!

bryan kennedy’s picture

Status: Needs work » Needs review
StatusFileSize
new38.9 KB

Here is a patch against dev/1.10-beta1

This resolves all coder issues.

I am going to open up a couple of other specific issues for stuff that I noticed in this process, but that I didn't want to muddy up this patch. This should mostly be changes:
-indentation (spaces not tabs)
-spaces after curly braces
-spaces after commas

bryan kennedy’s picture

StatusFileSize
new40.18 KB

Here's one more patch file for you to consider. This includes all of the changes I put into the above patch, but also all the recommended changes from coder_tough_love. I broke this one out separate just beacause I thought you might be reluctant to put all of these changes in at once. Anyways I'll let you take your pick.

mario_prkos’s picture

Both of them look good to me so I just peek first one. Now code look much better, cool!

dddave’s picture

Are those changes included? If so this issue can be closed.

mario_prkos’s picture

Yes there are.

dddave’s picture

Status: Needs review » Closed (fixed)

Well, then lets close this. Included since november, nobody complained. Great.

steven jones’s picture

Assigned: bryan kennedy » steven jones
Status: Closed (fixed) » Active

This needs addressing again.

bryan kennedy’s picture

Let me know if you need help going through the module. I know this sort of code cleanup can be a tedious process. Maybe we can divide it up in halves? Who knows, maybe that's more work than it's worth. Either way, I can help if you'd like.

simon georges’s picture

Hi.

I've started the work (applying coder review to all views-related files). I've attached the patch and the files as well, just in case.
I plan to perform the same on the module, maybe tomorrow, unless somebody's already doing it.

Regards,

dddave’s picture

Priority: Minor » Normal
Status: Active » Needs review

status...

Setting the priority back to normal. We have now four states and I don't think this is lowest priority.

simon georges’s picture

Hi,

I've completed the "coder fix". For pollfield.module, there was too much to fix, so I used the coder_format script.
While I was at it, I've made the css file uniform (space after ":", 2 spaces identation).

The attached patch includes the full review (the one doing yesterday, same as in #23, as well as today'one). I've attached the .css and the .module as well.

Regards,

bryan kennedy’s picture

Assigned: steven jones » bryan kennedy
Status: Needs review » Fixed

Thanks for all the work on this. I went through the coder module and made all the changes directly. It was just easier than reviewing these patches, because of the size of the changes. The entire module in the latest dev branch should be in line with the Drupal coding standards. Going forward we will keep it that way.

Status: Fixed » Closed (fixed)
Issue tags: -Coding standards

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