Speed Form Blocks (excuse silly name, was aiming for something definitely unique) is designed to allow a site maintainer to quickly create a new simple feedback form within a block. A block created in this way can then be used to garner feedback or comments from users of the site without the need to go to another page - "inline" as it where.

A user can create a form, which is then stored in the database table
This data is then presented via _block_info to drupal, and via structure | blocks allows a site admin to add the block to part of their site
Data received (via Ajax submission) is stored in a second database table and this is presented via a series of admin panels to allow for analysing feedback and exporting CSV files.

I considered the webform module, but this seemed to allow the creation of a separate page, not a form element inline as this code does.

I've put the code through http://ventral.org/pareview and there are some formatting errors, but mostly to do with issues with PHPDOC commenting that I don't quite get. It's also gone through Code review several times and passes there except for one check_plain issue which I think isn't a problem.

I'm largely self taught PHP, and not a brilliant coder by any stretch of the imagination. I tend to work openly and thought I'd written something useful so I might as well share it (http://www.github.com/patlockley / http://wordpress.org/extend/plugins/profile/pgogy) as it's more positive than keeping code to myself.

I'm relatively new to drupal (as I am now using it at work) but have tried as best I can to read around and work in a "drupal" way so as to make sure submission wouldn't be too much of a burden. I've worked (as a sort of lead) on one large open source educational project (xerte) and I know how much effort maintaining a community can be, so I'd hate to be a burden when I am sure there are much more pressing issues than this.

I currently have 5 sandboxed projects (including this one), so I thought explaining why I chose this one to go forward would indicate having read the manual a little - and that if there isn't a lot of code in this module, that other modules I have would perhaps help assess my work.

Speedy G (http://drupal.org/sandbox/pgogy/1351176) - Is basically boost, but a simpler version. We needed something like boost but there wasn't a version 7 which worked. I am not convinced this is needed as a project
Cache Scalpel (http://drupal.org/sandbox/pgogy/1351174) - Not sure that I understand drupal caching enough to make this work properly, but still handy I feel (would happily work this one up to a better module)
Code Tracker (http://drupal.org/sandbox/pgogy/1351178) - A sort of devel like module to find out if blocks run slowly. We had a problem with the work site that without caching it wasn't very fast, but devel could tell us which queries took a long time, but not always which block was the problem. I'd like to develop this further, but as it doesn't have an admin side or database install code then it's perhaps not showing enough "drupal" to be submitted as a first module
Learning Registry Block (http://drupal.org/sandbox/pgogy/1378742) - A rehash of a WordPress plugin I wrote, too simple to put forward as a first module.

git clone --branch 7.dev pgogy@git.drupal.org:sandbox/pgogy/1370108.git

Is the Git for the dev branch

http://drupal.org/sandbox/pgogy/1370108

Is the sandbox URL

The module is for Drupal 7

Many thanks for any feedback or help people can give.

Reviews of other projects
http://drupal.org/node/1470288#comment-5732616
http://drupal.org/node/1425720#comment-5732518
http://drupal.org/node/1426234#comment-5732826

2nd Review
http://drupal.org/node/1540804#comment-5897534
http://drupal.org/node/1535540#comment-5897562
http://drupal.org/node/1452328#comment-5897662

3rd Review
http://drupal.org/node/1553456#comment-5975976
http://drupal.org/node/1445730#comment-5976220
http://drupal.org/node/1549480#comment-5976318

4th Review
http://drupal.org/node/1574548#comment-5995390
http://drupal.org/node/1570724#comment-5995436
http://drupal.org/node/1547072#comment-5995620
http://drupal.org/node/1579958#comment-5999886
http://drupal.org/node/1463004#comment-6000016

5th Review
http://drupal.org/node/1585740#comment-6005218
http://drupal.org/node/1585642#comment-6005242
http://drupal.org/node/1573560#comment-6005274
http://drupal.org/node/1570606#comment-6008612

6th Review
http://drupal.org/node/1591870#comment-6020186
http://drupal.org/node/1592084#comment-6020292
http://drupal.org/node/1593136#comment-6021468

7th Review
http://drupal.org/node/1598666#comment-6036848
http://drupal.org/node/1599236#comment-6037360
http://drupal.org/node/1596172#comment-6031844

Comments

patrickd’s picture

Status: Needs review » Needs work

http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7dev
Please tell me which ones you don't understand, I'll try to explain them to you.

Your not working correctly with branches to create project releases. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.

pgogy’s picture

Hello,

Firstly thanks for the git checking tool - I couldn't find anywhere obvious on the website to acknowledge you personally, but would like to do so now.

FILE: ...dules/pareview_temp/test_candidate/speed_form_blocks.block_creation.inc
--------------------------------------------------------------------------------
FOUND 10 ERROR(S) AFFECTING 10 LINE(S)
--------------------------------------------------------------------------------
12 | ERROR | Parameter comment must be on the next line at position 1

Not sure what this means

47 | ERROR | Expected "}\nelse {\n"; found "}\n\nelse{\n"

I'm using Windows to edit the file, and in the text editor I am using I see }\nelse {\n not }\nelse{\n

I will read up on the git instructions later.

Thanks

Pat

patrickd’s picture

  }
  else{

->

  }
  else {

my editor is also showing this, maybe you should switch your editor

pgogy’s picture

Hello

http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7x-11dev

Reports all ok bar check_plain potential issues. I've gone through and added check_plain or filter_xss_admin to the nodes where HTML might be used.

Thanks for your help.

pgogy’s picture

Update for all.

The current branch I am using is 7.x-1.1.dev pgogy@git.drupal.org:sandbox/pgogy/1370108.git

Hope this helps.

pgogy’s picture

Status: Needs work » Needs review

Should I set this to needs review?

misc’s picture

Status: Needs review » Needs work

Hi,

Quite big module :-)
Here is my review of the 7.x-1.1.dev branch. Should be 7.x-1.x-dev.

Master Branch
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Readme
Please take a moment to make your README.txt follow the guidelines for in-project documentation.
Filename should be README.txt
speed_form_blocks.block_creation.zip
You have a zip in the module directory, what it is for?
speed_forms_block.info
Remove configure = admin/structure/speed_form_blocks, more about structure of the info-file here: http://drupal.org/node/171205
Remove@ author and @version
That information could instead be in the README.txt
Santanize POST
In must places you sanitize values - but in speed_form_blocks_management_handler you do that first after you add the value to the foreach - why?

Also you have some formatting issues, mostly about identing: http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7x-11dev

When I enable the module (with drush) I get the warning

Invalid argument supplied for foreach() block.module:385                      [warning]

Also when I try to create a new block with the name Testblock I get the warning

The machine-readable name must contain only lowercase letters, numbers, and underscores.

But it does not say in the description that the name need to follow that pattern

In the field 'Name for this form element', the does not disappear when it is focused, I have to manually delete the text in the field, the same for User guidance for this field

I create a block with a textfield. Add it to a sidebar. The textfield shows, but no text on the submit button. I can submit. I do not get any message. After that I notice that you can add text to the button and other stuff also. When I do so, it works. Maybe I should have known that if there were text in the README :-)

I think you only have some small issues to take care about. It works, but need some small improvements.

pgogy’s picture

Thanks for the feedback.

I think the new GIT is 7.x-1.x-dev pgogy@git.drupal.org:sandbox/pgogy/1370108.git

But I am not sure if that worked.

Readme

Should now be neatened up and more informative

speed_form_blocks.block_creation.zip

Deleted - was an admin error

speed_forms_block.info

Removed

Remove@ author and @version

Removed

Santanize POST
In must places you sanitize values - but in speed_form_blocks_management_handler you do that first after you add the value to the foreach - why?

I am looping over an array of post variables to create an array which I then serialize. I wasn't sure if this was needed, but I wanted to be certain

Also you have some formatting issues, mostly about identing: http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7x-11dev

I can't get the latest git to work, so I can't see what is wrong in this sense

When I enable the module (with drush) I get the warning

Invalid argument supplied for foreach() block.module:385 [warning]
Also when I try to create a new block with the name Testblock I get the warning

I have added a return statement in *_block_info - that fixed it for me.

The machine-readable name must contain only lowercase letters, numbers, and underscores.

Changed the guidance

I create a block with a textfield. Add it to a sidebar. The textfield shows, but no text on the submit button. I can submit. I do not get any message. After that I notice that you can add text to the button and other stuff also....

Changed the guidance

Hope this helps

pgogy’s picture

Status: Needs work » Needs review

Also, no obvious way to remove the #default_value when a form is clicked on? Tempted to leave it empty.

rudiedirkx’s picture

StatusFileSize
new44.64 KB

1. This is what I get when I install (using Drush):

The following extensions will be enabled: speed_form_blocks
Do you really want to continue? (y/n): y
Invalid argument supplied for foreach() block.module:385             [warning]
Invalid argument supplied for foreach() block.module:385             [warning]
speed_form_blocks was enabled successfully.                          [ok]

Installation errors = bad.

2. When I 'start' a block and add 1 field, I get this form:

speed form blocks form

That's very unclear. The element I just made, now appears twice and the form has grown bigger... What do I do next? Since the page has refreshed (and changed) a message would be very useful.

3. 'file path' => $path, in hook_menu is unnecessary, since $path is your module path and that's the default.

4. I'm seeing a lot of trailing spaces. I'm not sure how the Drupal coding standards like those, but I don't. Your editor probably has a macro to remove those. (In (Win) Notepad++ it's Alt+Shift+S.)

5. This isn't the right comment format:

/**
   *
   * Function speed_form_blocks_forms
   * This function handles the drupal hook to have one function to display the forms created using this module
   * @version 1.0
   * @author Patrick Lockley
   */

Use:

/**
 * Implements hook_forms().
 *
 * This function handles the drupal hook to have one function to display the forms created using this module. << Note the trailing period.
 */

6. Pareview finds a lot of issues.

rudiedirkx’s picture

Status: Needs review » Needs work
rudiedirkx’s picture

I'm on branch 7.x-1.x-dev btw. (I think "7.x-1.x" would be good enough. A branch is always dev. A release needs that flag, a branch doesn't.)

rudiedirkx’s picture

Your function speed_form_blocks_deletion_handler is really bad/wrong/incorrect. You should never, ever have to call $_POST in a submit handler. (Do correct me if I'm wrong.)

Never, ever, ever trust user input.

The Form API filters use input for you. Use $form_state['values'] to get it.

pgogy’s picture

thanks for that, the UX stuff was really handy.

not sure what happened with whitespaces - guess a lot of code changes made it messy. Apologies.

http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7x-1x seems fine now

I have tried to neaten up the UX as per #10
I don't get an install error anymore with #10
bullet point #3 of #10 is fixed
Commented .module as per hooks with #10

#12 the branch is now 7.x-1.x
#13 is resolved - no mentions of post in form handlers anymore

Thanks for your time on this,

pgogy’s picture

Status: Needs work » Needs review
rudiedirkx’s picture

1. Function comments are still a bit off. Write them to be parsed by a docs generator. Once your module becomes hugely popular, it will be useful for developers. See this nodequeue example. Extracted from this comment.

Specifically: no need to mention the function's name, version or author. Version and author are okay, if you want, but the name is unnecessarily verbose.

2. Pareview tells me: README.txt is missing, see the guidelines for in-project documentation.

3. The form is more obvious now, but it's still imperfect IMO. If you want to add 4 elements, the form will be huge in the end. You could (?) save the block ('unpublished') between creating elements.

4. I checked out branch 7.x-1.x, but I still see $_POST in speed_form_blocks_callback(). Am I behind or is it actually still there?

5. Any reason you're explicitly not caching in speed_form_blocks_block_info()?

6. I'm surprised Pareview doesn't mention this:

          case 0 : $type = 'checkbox';
            break;
          case 1 : $type = 'date';
            break;
          case 2 : $type = 'textformat';
            break;

See the coding standards on switch (...).

7. On admin/structure/speed_form_blocks/creation, you could use type machine_name to fill the machine name from a title. (Ignore this if you think there's reason for a block to have a human readable title.) See the Form API for examples and details on machine_name.

8. This is tiny and in no way related to Drupal's coding standards, but it's related to mine =) This is (very) inefficient:

      for ($x = 0; $x < count($form_state['storage']['form_elements']); $x++) {

because you're counting every iteration of the loop, but the count doesn't change. Count it once and use that number in the loop. Also good for readability:

      $size = count($form_state['storage']['form_elements']);
      for ($x = 0; $x < $size; $x++) {

Like I said: tiny.

9. You might want to consider requiring fields in the creation form. Everything except "User prompt ..." I'd say. Crazy results if you add a few nameless fields =)

Beyond these few thingies, I like.

rudiedirkx’s picture

Status: Needs review » Needs work

Two more things

10. The "Button label" and "CSS class" (block properties) are textarea's... Is that intentional? Textfields feel more natural and make more sense IMO.

11. More fields in the Block management tab should be required. I'd say all of them except "HTML before", "HTML after" and "CSS classes".

rudiedirkx’s picture

Okay, just two more.

12. No way to edit a block?

13. Are all the tabs necessary? There's a lof of them.

  • You could fit admin/structure/speed_form_blocks into a hook_help.
  • I think you could combine Block management and Deletion (maybe)
  • You can definitely combine Manage feedback and Responses
rudiedirkx’s picture

Oh btw... The Webform module offers an option to render webforms as blocks. Very nicely actually. Optionally including the rendered node.

You might want to consider that =) Your time might be spent more wisely contributing to Webform.

And that's four in a row. That's enough. Cool module!

pgogy’s picture

Status: Needs review » Needs work

Cheers

1. Tried to neaten function comments

2. README.txt is there (weird GIT case sensitivity).

3. The form can be changed if you change your mind when completing it - so it can get very long, but you can also change it at any point.

4. POST all gone.

5. Caching prevention removed

6. Switch done

8. Done

9. All fields required

10. Set to textareas

11. See 9

12. You can now edit a block

13. Dropped two of the tabs.

As for webform, it does - but I never found it when I tried to use webform, I find some modules have really complicated interfaces - why this one had too many tabs originally. It still seems much harder to set up. Webform is clearly more powerful a module, but this is a simple module to do simple things :) I almost called it simple form blocks.

Thanks for your help though

pgogy’s picture

Status: Needs work » Needs review
rudiedirkx’s picture

Status: Needs work » Needs review

The README is unacceptable =)

This is from the project page. Much better than the module's README.

Designed to allow the simple and fast creation of forms as part of a block.

Built to solve a problem with requiring simple forms for user feedback on a site and not having an obvious module to do so.

  • Which modules does it include? (One project has >= 1 module.)
  • What does it do?
  • What happens when I turn it on? (Where are the settings?)
  • Do I need to be careful of something? Any tips on usage?
  • I am a module. Can I extend you? Where? How? Hooks? Interface?
  • Any modules that you're friendly with? Extensions? Plugins?

It's good to have this in the README as well as on the project page.

Sorry man. I'm pretty new to moduling and reviewing myself, so I don't want to be too easy.

rudiedirkx’s picture

Write docs and README's with this in mind:

  • everybody is stupid and needs explanation
  • nobody reads

(Not developer docs!)

rudiedirkx’s picture

Status: Needs review » Needs work

Two more, but maybe you should've learned these by trying/yourself:

1. You can write

function speed_form_blocks_forms($form_id, $args) {

like

function speed_form_blocks_forms($form, $form_state, $delta = NULL) {

and not do the $args and build_info thing. I guess the drupal_get_form docs aren't very forthcoming about that... Well there you have it! Arguments passed to drupal_get_form are passed to the form definition function directly. Just in case though, make them optional.

2. Drupal 7 has a type => 'action' form element. Usually that's where forms put their actions/(submit) buttons. (You can add $data->post_html to that element like you're doing now, OR create a separate (type => 'markup') element for that.)

pgogy’s picture

Cheers, the readme was just a stub. The only one went missing.

Will fix all tonight.

pgogy’s picture

README.txt updated
.module _forms hook improved ($args removed).

Couldn't get type => action to work, so left as is. Not sure if #suffix is better than a whole new array element?
Seems #suffix is neater.

pgogy’s picture

Status: Needs work » Needs review
rudiedirkx’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new51.44 KB

AUCH:

      '#title' => t($block->block_name . " Other settings (click to minimise)"),

I almost missed that one. That is very uncool. You know why. Fix that. Only string literals in t()!

#type => actions is better. Every form's (submit) buttons should be in an actions container. Do note that it is "actions" and not "action". If you forget about anything Form API, just search for "drupal fapi" anywhere.

A few more pointers you can use so you wish:

See the configure directive on Writing .info files. For users it's immensely useful to know where to start (configuring).

The very most important and powerful hook in Drupal is the form_alter. Every developer starts there if they want to change something. Make sure your forms return something alterable. Currently the element names aren't optimal:

    [test_So... What's going on here?] => Array
        (
            [#type] => textfield
            [#title] => So... What's going on here?
        )

That's because the "Name for this form element" elements can contain anything. (Including nothing.) See attached screenshot. Most of those form elements should be #required. (Definitely Name and User prompt.)

I usually write queries like this: (note the extra spaces on lines 2 & 3)

    $num_deleted = db_delete('speed_form_blocks_created')
      ->condition('bid', str_replace("delete_", "", $key))
      ->execute();

Why all the white space here:

    '#markup'          => '<p>Deleting a block will not delete data</p>',

Why in every function:

  global $base_url;

This is problably not right: (double check_plain)

    $checked = check_plain($value_to_check);

    drupal_set_message(check_plain($checked) . t(": This Block name is already in use. Please choose another name"), 'warning');

Also the t() string is strange. Don't start with ": ". Better use a placeholder inside the translatable string: t('@block_name: This block .....'). (This happens a few times.)

White space:

    $form[$block->block_name][$block->block_name . "_blockname"] = array(
      '#type'          => 'hidden',
      '#value' => $block->block_name,
    );

Why the check_plain?

        db_update('speed_form_blocks_created')
        ->condition('bid', $value[$key . "_bid"])
        ->fields(array('block_name' => check_plain($value[$key . "_newname"])))
        ->execute();

There's a few more things I would've done differently, but different isn't necessarily better and definitely personal.

There's one must fix. After that I think I'm satisfied =)

pgogy’s picture

I almost missed that one. That is very uncool. You know why. Fix that. Only string literals in t()!

Fixed, and used placeholders in all the other places

#type => actions is better. Every form's (submit) buttons should be in an actions container. Do note that it is "actions" and not "action". If you forget about anything Form API, just search for "drupal fapi" anywhere.

Done I think

See the configure directive on Writing .info files. For users it's immensely useful to know where to start (configuring).

Added the configure line to the .info and moved the pacakge to "user interface"

The very most important and powerful hook in Drupal is the form_alter. Every developer starts there if they want to change something. Make sure your forms return something alterable. Currently the element names aren't optimal:
That's because the "Name for this form element" elements can contain anything. (Including nothing.) See attached screenshot. Most of those form elements should be #required. (Definitely Name and User prompt.)

Ok have made a few more fields required and added some extra validation in.

I've tried to remove the array whitespacing where I saw it.

Why in every function:

global $base_url;

bad copy and pasting - removed now

Sometimes I add a check_plain just to be safe - too much

Happy to make more changes.

Thanks a load for your help, please let me know if I can help you in anyway?

Quick question - after this is approved, where should I discuss project ideas?

pgogy’s picture

Status: Reviewed & tested by the community » Needs review
rudiedirkx’s picture

Status: Needs review » Needs work

Almost =)

1.

    drupal_set_message(check_plain($value_to_check) . t(": This Block name is already in use. Please choose another name- FUCK OFF"), 'warning');

t() string is still off. Don't start with ": ". Include the param in the t() string or add ": " in between. And obviously there's one "FUCK OFF" too many.

Also: if this message is a blocker, show it as an "error", not a "warning". Block names MUST be unique, so a duplicate is a validation error. Warnings aren't blockers (the block would be saved, but not perfectly).

Perfect IMO:

    drupal_set_message(t("Block name %name is already in use. Please choose another name", array('%name' => $value_to_check)), 'error');

Didn't know %? There's three types of placeholder.

2.

    '#markup' => t('<h3>Add a new field, or edit the field above</h3>'),

Better to have the tags outside the t() string, so you can change markup later without changing the t() string. The same in ...response.inc.

    '#markup' => '<h3>' . t('Add a new field, or edit the field above') . '</h3>',

3.

    $form['inline_feedback_main'] = array(
      '#markup'          => '<h3>Responses received from Speed form blocks</h3>',
    );

Should be translated. In a few more locations. Even standalone words like "Settings" must be translated. Check every English literal you type. All of them must be translated in the end. (Some directly (like here) and some indirectly (like menu item titles).)

4.

    'title' => t('Speed Form Blocks'),
    'description' => t('Create Speed form blocks'),

Menu item titles shouldn't be translated. The menu system does that (via "title callback"). See hook_menu. The same goes for "description".

5.

It's not wrong per se, but I'm not a fan. In fact, it's a horrible practice:

    foreach ($result as $result) {
      // ...
      return TRUE;
    }
    return FALSE;

Don't foreach when you're bowing out at the first element. Just fetch the first record and check against it:

    $query = db_query('... LIMIT 1'); // or use the query builder: db_select(..)->...
    $exists = $query->fetch();
    return (bool)$exists;

And a minor (IMO) but simple: http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git Only a README in master branch.

pgogy’s picture

1) Sorry, got angry with the code and left it in by mistake
2) All done I think
3,4,5) All done too

Again, many many thanks

Pat

pgogy’s picture

Status: Needs work » Needs review
rudiedirkx’s picture

Status: Needs review » Reviewed & tested by the community

Excellent =) Let's get it out there.

The actual approving has to be done by someone else. I think only a few can. Now it's "Reviewed and tested by the community", that shouldn't take long.

If you need more feedback, you can join several Drupal Groups, one of which: http://groups.drupal.org/code-review

pgogy’s picture

Thanks loads for your help. If you ever need some help or testing please do let me know.

klausi’s picture

Would you like to take part in the review bonus program? I personally only review/approve applications with a review bonus, but of course you can also wait for other git administrators to take a look at your code.

pgogy’s picture

I'd like to help - I'm spread pretty thin over a lot of open source stuff, but I will have a look at some projects tonight.

Thanks

rudiedirkx’s picture

Don't you trust me, @klausi? =)

patrickd’s picture

this is not about trust, a git admin should do a (hopefully) last review before fixing an issue. ;)

pgogy’s picture

Issue tags: +PAreview: review bonus

Update for review bonus.

Please note I only have limited drupal experience (version 7, single user sites) and I am not a great coder - so if they reviews I did aren't enough to merit a bonus I understand completely :) Please consider them in the spirit intended. No problem if not enough.

Cheers all

Pat

klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus
StatusFileSize
new3.87 KB

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  • project page is too short, see http://drupal.org/node/997024
  • commit messages: "Signed-off-by: unknown ": this is not very help full, please see http://drupal.org//node/52287
  • speed_form_blocks_schema(): doc block is wrong, see http://drupal.org/node/1354#hookimpl
  • speed_form_blocks_schema(): why is the block column 2000 in length? I think block names are a lot shorter?
  • speed_form_blocks_schema(): the extra field should use the "serialize" property, see http://drupal.org/node/146939 . Also you should probably use a different type (blob?), see http://drupal.org/node/159605
  • speed_form_blocks_schema(): please also check your other db columns, you use varchar and 2000 where it might not make sense.
  • "@version 1.0": we do not use the @version in Drupal, as version information is tracked by Git.
  • "'access arguments' => array('administer site configuration'),": this permission is too generic, create your own.
  • speed_form_blocks_forms(): what is going on this hook, you are not mapping any form callbacks here? The content does not match the purpose of hook_forms(). http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
  • speed_form_blocks_callback(): "$form_state['input']": why do you need to use the raw data from $form_state['input'] and can't use validated $form_state['values']?
  • speed_form_blocks_mainhelp(): why do you need that extra function and why don't you just put that into hook_help()?
  • speed_form_blocks_mainhelp(): use url() to generate URLs.
  • speed_form_blocks_form_creation(): this function is not called anywhere?
  • speed_form_blocks_creation_finalise(): do not use check_plain() when writing to the database. "When handling data, the golden rule is to store exactly what the user typed. When a user edits a post they created earlier, the form should contain the same things as it did when they first submitted it. This means that conversions are performed when content is output, not when saved to the database." http://drupal.org/node/28984
  • If you want to prefill a form element you should use #default_value, not #value. Please check that in all of your code.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

pgogy’s picture

Why do I lose my review bonus?

patrickd’s picture

Read about the review bonus workflow: https://drupal.org/node/1410826

manual review of 3 projects -> tag your application -> you'll get a review sooner -> tag will be removed -> manual review of 3 projects -> . ..... .

pgogy’s picture

Status: Needs work » Needs review

Have made changes according for code sniffer, but they clash with ventral, so have left the error in ventral as I assume code sniffer better.

project page is too short, see http://drupal.org/node/997024

Made longer

commit messages: "Signed-off-by: unknown ": this is not very help full, please see http://drupal.org//node/52287

Am now adding messages when I commit

speed_form_blocks_schema(): doc block is wrong, see http://drupal.org/node/1354#hookimpl

Modified

speed_form_blocks_schema(): why is the block column 2000 in length? I think block names are a lot shorter?

Block length set to be 32

speed_form_blocks_schema(): the extra field should use the "serialize" property, see http://drupal.org/node/146939 . Also you should probably use a different type (blob?), see http://drupal.org/node/159605

Changed accordingly

speed_form_blocks_schema(): please also check your other db columns, you use varchar and 2000 where it might not make sense.

Trimmed the length down to more reasonable numbers

"@version 1.0": we do not use the @version in Drupal, as version information is tracked by Git.

Removed

"'access arguments' => array('administer site configuration'),": this permission is too generic, create your own.

I have done but I've zero experience of using drupal sites with multiple users - the sites we have here are for broadcasting content so I don't know anything about user modules permissions. Done what I think is correct.

speed_form_blocks_forms(): what is going on this hook, you are not mapping any form callbacks here? The content does not match the purpose of hook_forms(). http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...

Speed_form_blocks_block_view - is built to generate the block when required.
Quoting from the page "Second, you could use this hook to define how to build a form with a dynamically-generated form ID."
So as each block contains a dynamically generated form I use this to generate the form for each block

speed_form_blocks_callback(): "$form_state['input']": why do you need to use the raw data from $form_state['input'] and can't use validated $form_state['values']?

No reason - failed to convert code when I did the rest of the work. Now using form_state['value']

speed_form_blocks_mainhelp(): why do you need that extra function and why don't you just put that into hook_help()?

Changed

speed_form_blocks_mainhelp(): use url() to generate URLs.

used l instead as it worked better

speed_form_blocks_form_creation(): this function is not called anywhere?

I can't find this function in my code

speed_form_blocks_creation_finalise(): do not use check_plain() when writing to the database.

Removed

If you want to prefill a form element you should use #default_value, not #value. Please check that in all of your code.

Fixed all the ones I could see

patrickd’s picture

BTW
ventral == drupal code sniffer

I just updated ventral.org/pareview today, are you sure your local version is up-to-date?

pgogy’s picture

Sorry, it wasn't a criticism. By better I should have said perhaps more "Formal".

I downloaded DCS on friday and have never used it before - so I would assume it's up to date.

It was about array elements needing to be on different lines - not sure it matters?

pgogy’s picture

Also, name a charity - I've used ventral so much I feel I owe you :)

pgogy’s picture

Issue summary: View changes

Added review bonus material - PAReview: review bonus

pgogy’s picture

Updated for review bonus

patrickd’s picture

Issue tags: +PAreview: review bonus

you tagged the issue wrong, must be "PAReview: review bonus"

corrected

pgogy’s picture

thank you for your patience - I'd still like to thank you for the help ventral gave me?

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Thanks for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).

Review of the 7.x-1.x branch:

  • Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: ...dules/pareview_temp/test_candidate/speed_form_blocks.block_creation.inc
    --------------------------------------------------------------------------------
    FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     300 | WARNING | A comma should follow the last multiline array item. Found: )
    --------------------------------------------------------------------------------
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  1. speed_form_blocks_schema(): This is a hook implementation and should be documented as such: http://drupal.org/node/1354#hookimpl
  2. speed_form_blocks_schema(): the closing ")" of a multiline array should be on its own line, see http://drupal.org/node/318#array
  3. "'access arguments' => array('administer site configuration'),": that permissions is not a godd fit. What about "administer blocks"? Or you could of course create your own permission for your blocks.
  4. speed_form_blocks_forms(): function signature does not match that from hook_forms()? Are you sure you want to implement that hook? http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
  5. You are using empty lines too excessively. They should be used to group code blocks together, and not after every single statement. Currently your code is very hard to read.
  6. speed_form_blocks_help(): do not concatenate translatable strings, use placeholders instead. Do not create link markup yourself, use l() instead.
  7. speed_form_blocks_permission(): ah, you define your own permission, so you should use it in hook_menu().
  8. speed_form_blocks_callback(): use drupal_write_record() instead of db_insert() and your data will be validated against the schema.
  9. speed_form_blocks_management(): remove the access check, that is done by the menu system.
  10. "'#value' => $data[$x]['type'],": do not use #value, use #default_value instead.
  11. speed_form_blocks_management_handler(): do not use check_plain() on input. "When handling data, the golden rule is to store exactly what the user typed. When a user edits a post they created earlier, the form should contain the same things as it did when they first submitted it. This means that conversions are performed when content is output, not when saved to the database." From http://drupal.org/node/28984
  12. speed_form_blocks_management_handler(): do not use the raw values from $form_state['input'], use $form_state['values'] instead.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

pgogy’s picture

http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7x-1x

reports as clear - see comment #46 for problems with Drupal Code Sniffer - I am using Ventral as my DCS reference point as it is easier to use.

speed_form_blocks_schema

re commented and put each ) on a new line

"'access arguments' => array('administer site configuration')," / speed_form_blocks_permission(): ah, you define your own permission, so you should use it in hook_menu(). / speed_form_blocks_management(): remove the access check, that is done by the menu system.

done

speed_form_blocks_forms(): function signature does not match that from hook_forms()? Are you sure you want to implement that hook? http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...

Quoting the page

By default, when drupal_get_form() is called, the system will look for a function with the same name as the form ID, and use that function to build the form. If no such function is found, Drupal calls this hook. Modules implementing this hook can then provide their own instructions for mapping form IDs to constructor functions. As a result, you can easily map multiple form IDs to a single form constructor (referred to as a 'base' form).

Using a base form can help to avoid code duplication, by allowing many similar forms to use the same code base.

To me, that is what this module does?

speed_form_blocks_help(): do not concatenate translatable strings, use placeholders instead. Do not create link markup yourself, use l() instead.

The comments on http://api.drupal.org/api/drupal/modules%21help%21help.api.php/function/hook_help/7 suggest it is ok? Should some one delete them then?

speed_form_blocks_callback(): use drupal_write_record() instead of db_insert() and your data will be validated against the schema.

Done

"'#value' => $data[$x]['type'],": do not use #value, use #default_value instead.

Done

speed_form_blocks_management_handler(): do not use check_plain() on input.

Done

speed_form_blocks_management_handler(): do not use the raw values from $form_state['input'], use $form_state['values'] instead.

done

pgogy’s picture

Status: Needs work » Needs review
pgogy’s picture

Issue summary: View changes

review bonus

pgogy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +PAreview: review bonus

PAReview: review bonus

klausi’s picture

Status: Reviewed & tested by the community » Needs review

Do not RTBC your own issues.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

Thank your for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).

Review of the 7.x-1.x branch:

  • Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: ...ites/all/modules/pareview_temp/test_candidate/speed_form_blocks.install
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     56 | ERROR | Line indented incorrectly; expected 2 spaces, found 4
    --------------------------------------------------------------------------------
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  1. Your commit messages are still broken: "Signed-off-by: patlockley ...".
  2. "'access arguments' => array('Administer Speed Form Blocks'),": permission does not match the one defined in hook_permission(). In general permissions should be all lower case.
  3. speed_form_blocks_forms(): function signature does not match that from hook_forms(). It should have the parameters $form_id and $args.
  4. "drupal_get_form("speed_form_blocks_forms", $delta)": speed_form_blocks_forms is not a form id. It is a generic hook that will map form ids. Why do you need hook_forms()? You do not do any mapping of form IDs in that function? Where do you have the requirement in your module that you would need to map several form IDs to one base form?
  5. "'#title' => $description,": this is vulnerable to XSS exploits. As $description is user provided input you need to sanitize it before printing it. See http://drupal.org/node/28984
  6. "$label = "Submit";": all user facing text must run through t() for translation.
  7. "'#suffix' => $data->post_html . '

    ',": I think you should do at least a filter_xss() or similar here to avoid XSS. See also http://drupalscout.com/knowledge-base/drupal-text-filtering-cheat-sheet-...

  8. speed_form_blocks_creation(): do not use #value on form elements, use #default_value instead. Please check that in all your form building functions.
  9. speed_form_blocks_creation_finalise(): use drupal_write_record() instead of db_insert() and your data will also be validated against the DB schema.
  10. speed_form_blocks_add_field_handler(): why do you call check_plain() here? You are not printing anything to the user? "When handling data, the golden rule is to store exactly what the user typed. When a user edits a post they created earlier, the form should contain the same things as it did when they first submitted it. This means that conversions are performed when content is output, not when saved to the database." from http://drupal.org/node/28984
  11. "'#title' => $block->page . t("Page (click to expand)"),": Again, $block->page needs to be sanitized here.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

pgogy’s picture

But your comment said

"Thank your for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws)."

Which is what I did?

patrickd’s picture

This sentence is for the case you review other modules - after you've done a review of other module you have to decide whether you set their issue to needs work or rtbc.

pgogy’s picture

What if the issue is a preference (i think a lot of modules could do with more help options, for example?)

patrickd’s picture

if it's only a preference -> it's not a review -> don't change status

pgogy’s picture

Status: Needs work » Needs review

1. Have tried to make commit messages more useful. I am using Git GUI - not sure how much I can change this as it is free text.
2. Set speed form blocks to be lower case.
3. Very, very sorry. I get what you mean now. I've swapped hook_forms for drupal_get_form and my own function.
4. Added in filter_xss where I think it is needed.
5. Changed all values - default values
6. Changed to db_insert into drupal_write_record

Sorry for the hook_forms hassle. Feeling dumb.

Also tested with ventral and code review.

pgogy’s picture

Issue summary: View changes

Adding review bonus links

pgogy’s picture

Issue summary: View changes

Adding reviews

pgogy’s picture

Issue summary: View changes

added another review, not enough for bonus so don't worry about that yet

pgogy’s picture

Issue summary: View changes

adding more reviews

pgogy’s picture

PAReview: review bonus

klausi’s picture

Issue tags: +PAreview: security

Please don't remove the security tag, we keep that for statistical purposes and to show examples of security problems.

pgogy’s picture

Sorry, didn't know if I had to have only one.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus
StatusFileSize
new4.4 KB

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  1. Commit messages look good now.
  2. "@version 1.0": we don't use the @version tag in Drupal doxygen docs, so remove it.
  3. speed_form_blocks_admin(): you don't need the user_access() check here, that is already done by the menu system.
  4. speed_form_blocks_help(): $base_url is unused.
  5. "'#value' => $block->pre_html,": you are still using #value in a lot of places instead of #default_value.
  6. speed_form_blocks_management_handler(): again: do not use the raw POST values from $form_state['input'], use $form_state['values'] instead.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

pgogy’s picture

Status: Needs work » Needs review

Hello

All changes made. I can't stop drupal code sniffer reporting \r\n errors for some lines (always the first and last lines in each file).

Thanks

pgogy’s picture

Issue summary: View changes

review bonus (i think)

pgogy’s picture

Issue summary: View changes

adding review links

pgogy’s picture

Issue summary: View changes

Adding reviews

pgogy’s picture

Issue tags: +PAreview: review bonus

Adding review bonus tag

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Manual review of the 7.x-1.x branch:

  1. The automated code review errors from comment #65 are not fixed. See http://drupal.org/node/1354#functions
  2. speed_form_blocks_export_data(): you are still using #value instead of #default_value for the text area here.
  3. speed_form_blocks_machine_name(): you are still using $form_state['input'] here. Please check all your code against the issues I already told you.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

pgogy’s picture

StatusFileSize
new3.54 KB

Hello,

1. When I run phpcs --standard=drupal --extensions=php,module,inc,install,test,profile,theme . I don't get those errors listed in the txt file you attached. I did get some other commenting issues, but not those ones. I assume there is some character problems in the sniffer? I've attached what I see when I ran my first test before making the changes.

I've had to guess at the changes because I can't get the same errors as your text file does. This is a bit of a problem.

2. Changed

3. That form_state never goes to a database, or the screen? I've changed it now, but handy to know for future reference?

pgogy’s picture

Status: Needs work » Needs review
pgogy’s picture

Issue summary: View changes

adding in reviews

pgogy’s picture

Issue summary: View changes

adding reviews

pgogy’s picture

Issue summary: View changes

Adding a review

pgogy’s picture

Issue tags: +PAreview: review bonus

Adding PAReview: review bonus

lucascaro’s picture

StatusFileSize
new1.75 KB

hi @pgogy the same thing happened to me with drupalcs and it ended out being that I needed the -dev version of drupal code sniffer. I'm attaching a dump of drupalcs for reference, it seems that there are still some minor issues.

2) Also in speed_form_blocks_export_data() it seems that it's still using #value, did you push your latest changes?

3) Seems to be correct now.

setting to needs work and keeping the pareview bonus tag for @klausi.

lucascaro’s picture

Status: Needs review » Needs work

*ahem*
sorry... now really setting to needs work.

pgogy’s picture

Status: Needs work » Needs review
StatusFileSize
new3.54 KB

Thank you.

I updated to the dev code sniffer and I got a bigger set of messages - I still get end of line and start of document errors....

Changes made and have attached what I see when I run c:\xampp\php\phpcs --standard=drupal --extensions=php,module,inc,install,test,profile,theme . now

lucascaro’s picture

Status: Needs review » Needs work

Hi @pgogy, I have some more issues that could help you pass a review:

whenever you're using:

'#title' => filter_xss($block->page) . " " . t("Page (click to expand)"),

you should consider changing it so it doesn't use concatenations, to avoid translation problems. A possible solution is to make it like:

'#title' => t("!page Page (click to expand)", array('!page' => filter_xss($block->page)),

If you don't need html in $block->page, you can use @page and remove the call to filter_xss.

This problem appears in lines 123 and 139 of speed_form_blocks.export.inc

I still see you're using #value instead of #default_value in lines 182 and 189 of speed_form_blocks.management.inc, and line 132 of speed_form_blocks.export.inc, and that could cause problems with the forms.

also, drupal code sniffer reports no problems!

I think after these changes this will be RTBC.

Cheers.

pgogy’s picture

Status: Needs work » Needs review

All done

lucascaro’s picture

Status: Needs review » Needs work

@pgogy cool, it looks good with pareview.sh and drupalcs. There are still some indentation and spacing issues, like too many spaces before the => and lines that go over 80 characters at:

$form['inline_feedback_main_no_responses'] = array(
      '#markup'          => '<p>' . t('No responses have been received or no blocks have been set up.') . '</p><p>' . t('If no blocks have been created yet, please visit') . ' <a href="creation">' . t('block creation') . '</a></p>',
    );

which I'd rewrite as:

$form['inline_feedback_main_no_responses'] = array(
      '#markup' => '<p>' . t('No responses have been received or no blocks have been set up.') 
        . '</p><p>' . t('If no blocks have been created yet, please visit') 
        . ' <a href="creation">' . t('block creation') . '</a></p>',
    );

Also, there are some indentation errors that you might want to correct before getting another review from @klausi.

* in speed_form_blocks.responses.inc
- lines 22, 85, 94
* in speed_form_blocks.management.inc
- lines 25, 43, 48, 59, 208.

There are also several places that need better indentation. It should always be 2 spaces, so at speed_form_blocks.responses.inc @lines 127-130 you need to add indentation for the ->condition and ->execute lines. Also, in general the indentation should be of 2 spaces.

One last thing is that the commits are still showing as "by patlockley" instead of pgogy and that should be corrected (see http://drupal.org/node/1022156).

I think the last one is a blocker so I'll set it to needs work, but as soon as that's corrected I think this is ready for RTBC!

pgogy’s picture

Status: Needs work » Needs review

All done, found a few more - so used to coder and ventral I'd forgotten to use my own eyes.

Told git who I am for this repository as well

Thanks

Pat

lucascaro’s picture

Status: Needs review » Reviewed & tested by the community

great @pgogy, I still see some indentation issues in speed_form_blocks.management.inc around line 300:

              db_update('speed_form_blocks_created')
                ->condition('block_name', $block->block_name)
                ->fields(array(
                         str_replace($block->block_name . "_", "", $setting)
                         => filter_xss_admin($value)))
                ->execute();

and 316

            db_update('speed_form_blocks_created')
              ->condition('block_name', $block->block_name)
              ->fields(array(
                        str_replace($block->block_name . "_", "", $key)
                        => filter_xss_admin($value)))
              ->execute();

But IMHO it's good enough for a RTBC!

pgogy’s picture

Thanks

I changed it to

db_update('speed_form_blocks_created')
  ->condition('block_name', $block->block_name)
  ->fields(array(
    str_replace($block->block_name . "_", "", $key)
    => filter_xss_admin($value)))
  ->execute();

is that better?

lucascaro’s picture

I think it's ok, but what about:

$field_name = str_replace($block->block_name . "_", "", $key);
db_update('speed_form_blocks_created')
  ->condition('block_name', $block->block_name)
  ->fields(array($field_name => filter_xss_admin($value)))
  ->execute();

or, if it's over 80 characters:

$field_name = str_replace($block->block_name . "_", "", $key);
db_update('speed_form_blocks_created')
  ->condition('block_name', $block->block_name)
  ->fields(array(
    $field_name => filter_xss_admin($value)
  ))
  ->execute();

anyways it's not a blocker so it's up to you.

lucascaro’s picture

Status: Reviewed & tested by the community » Needs work

Actually @pgogy, I was discussing it in IRC and @klausi noted that filter_xss_admin it's not supposed to be in those lines, it's supposed to be used when you're generating output, and not when saving in the database.

So please give it another look and remove the two instances of filter_xss_admin on input and please check that you're using it whenever you're outputting user generated text.

Sorry for going back to needs work, but I hope this helps getting this project published!
Also, still leaving the review bonus tag for @klausi.

pgogy’s picture

Status: Needs work » Needs review

All done (added it a lot on the admin side - wasn't sure it was needed on the admin side?)

lucascaro’s picture

@pgogy you don't need to filter for #default_value, but you must always filter #value and #markup (see http://drupal.org/node/28984).

pgogy’s picture

Ok, I mostly added it to titles on forms (expandable ones). no on default value. So I think I am ok.

Cheers for your help and patience? Can i repay you in anyway?

lucascaro’s picture

Status: Needs review » Needs work

Getting close @pgogy, the pareview.sh script returned some errors though, it seems that there are some spacing / tabs issues:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.


FILE: .../sites/all/modules/custom/speed_form_blocks/speed_form_blocks.admin.inc
--------------------------------------------------------------------------------
FOUND 8 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
 14 | ERROR | String concat is not required here; use a single string instead
 15 | ERROR | Spaces must be used to indent lines; tabs are not allowed
 15 | ERROR | Line indented incorrectly; expected 2 spaces, found 1
 15 | ERROR | Array indentation error, expected 4 spaces but found 1
 18 | ERROR | Spaces must be used to indent lines; tabs are not allowed
 18 | ERROR | Line indented incorrectly; expected 2 spaces, found 1
 18 | ERROR | Array indentation error, expected 4 spaces but found 1
 19 | ERROR | Concat operator must be surrounded by spaces
--------------------------------------------------------------------------------


FILE: ...es/all/modules/custom/speed_form_blocks/speed_form_blocks.responses.inc
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 94 | ERROR | Whitespace found at end of line
 95 | ERROR | Spaces must be used to indent lines; tabs are not allowed
 95 | ERROR | Line indented incorrectly; expected 4 spaces, found 3
 95 | ERROR | Array indentation error, expected 6 spaces but found 3
--------------------------------------------------------------------------------

As repay, you can consider giving reviews to other people :)

patrickd’s picture

Status: Needs work » Needs review

the issues found are minor and should not be required for approval, therefore please do not insist on having them fixed and do not switch the issue to needs work if there are no major issues found.

lucascaro’s picture

sorry @patrickd, i didn't mean to stall the issue, I actually meant to help. Thanks for clarifying that.

pgogy’s picture

StatusFileSize
new3.54 KB
new1.41 KB
new818 bytes

Ok, sorry about those - I got confused as to which lines need to be shorter than 80 characters - so reformatted some text and broke it.

Reason for this is sometimes ventral and coder report differently.

So before the last change (the change before the most current one)

Drupal Code Sniffer reported as such (see attachment)
Ventral reported (see attachment)
Code Review reported (see attachment)

Now (most current GIT)

http://ventral.org/pareview/httpgitdrupalorgsandboxpgogy1370108git-7x-1x Ventral is clear
Code review says I have a file block missing
Code Sniffer doesn't like how my documents start and end

So I have three different responses? I know these are to help - but it gets odd when I get different responses.

It seems people always use ventral in the first instance, but then switch to code sniffer - which see different things? Makes working out how to be approved a little awkward.

lucascaro’s picture

Hey @pgogy I think the online version is older than the latest -dev for drupalcs. As mentioned by @patrickd those are minor issues, so it's up to you I guess.. What I did is I tried to remove all errors and warnings just in case, but it shouldnt block your application.

On my end, I've pulled your changes and pareview.sh and drupalcs seem happy with your code.

pgogy’s picture

Thanks, Do I need to do anything else?

lucascaro’s picture

This is set to needs review and you have a pareview bonus so you just need to wait to get a review from @klausi.

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

manual review:

  1. speed_form_blocks_menu(): $path is unused.
  2. speed_form_blocks_form_maker(): function parameters are wrong: the first should be $form, the second $form_state and the third $delta. Then you don't need to access $delta['build_info']['args'][0] and you can use $delta.
  3. "$button = filter_xss($data->button);": the title of a button should always be plaintext, no? So you should use check_plain() instead.
  4. There are still a lot of useless newlines in your code that do not separate code blocks, which is bad for readability.
  5. speed_form_blocks_machine_name(): you should use the machine_name form element instead, then you don't need this function. See http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
  6. speed_form_blocks_creation_name_exists(): the "%" placeholder will sanitize the variable for you, so the filter_xss() is not needed.
  7. speed_form_blocks_creation(): doc block: The first line of the block should begin with a verb in the form "Does such and such", i.e. "Handles the Block Creation Admin Page." instead of "This function handles the Block Creation Admin Page.". Also elsewhere. See http://drupal.org/node/1354#functions . @param and @return for the standard parameters and return value should be omitted from all form-generating functions. See http://drupal.org/node/1354#forms
  8. speed_form_blocks_management(): another filter_xss() where not necessary ("@" placeholder). Also in speed_form_blocks_responses() and possibly elsewhere.

Although you should definitively fix those issues they are no blockers, so I think this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution and welcome to the community of project contributors on drupal.org!! :)

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process and your help in the application queue. 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.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

pgogy’s picture

Status: Fixed » Reviewed & tested by the community

Hello

1. Removed
2. Changed
3. Changed
4. I've removed what I think are the obvious ones - I am not sure how I should best do it? I've tended to work in places where I am the only PHP person and so I have always over spaced to make the code a little easier to follow (for them, as they asked for it).
5. Changed
6. Done
7. Done as best I can
8. Removed or replaced where I think it needs it.

Thanks

pgogy’s picture

Issue summary: View changes

adding reviews

pgogy’s picture

Issue tags: +PAreview: review bonus

Adding review bonus tag back in

patrickd’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -PAreview: review bonus

As per #94 you reached the end of this application, congratulations, please leave it fixed ;-)

pgogy’s picture

Status: Fixed » Reviewed & tested by the community
Issue tags: +PAreview: review bonus

Adding review bonus tag back in

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

Review bonus is not needed anylonger - this issue is finished - your application is approved - see comment #94

pgogy’s picture

Status: Fixed » Reviewed & tested by the community

@patrickd

Sorry, I hadn't refreshed in time, and then the form through an error on me and died.

Thank you very much, I half wanted to make 100 comments so I'd be officially the worst coder ever

@klausi

Thanks for everything. I've been utterly useless as this, and you have been amazing

@The rest

and you

I'll keep reviewing (well sticking code through ventral and trying to pick fault) as best I can :)

If I have new ideas for modules what do I do now? Same process?

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

As successful completion of the project application process results in the applicant being granted the ´Create Full Projects´ permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers. See documentation about full projects (and sub-pages).

pgogy’s picture

Thanks, I thought that was the case, it's just we use drupal in a very specific way here, and I was worried about creating modules that are spurious.

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

Anonymous’s picture

Issue summary: View changes

Adding review bonus