For review, this is a simple module that gets official information from United Nations website (XML format) and puts the information into a page/node. The idea is to get always updated information from UN and to show it in your website.

Node name is united_nations_peacekeeping_operations. Thus, once enabled, this module will allow you to access this page via http:// someURL /united_nations_peacekeeping_operations.

Project: http://drupal.org/sandbox/kravetz/2452999

To clone the project:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/kravetz/2452999.git united_nations_peacekeeping_operations

I myself put already in my working Drupal 7.34 sample website at http://www.drupalcommunity.com.br/united_nations_peacekeeping_operations.

A very simple module, with few hooks. I hope everything is fine with code and standards.

CommentFileSizeAuthor
unpko.png29.01 KBRodrigo Kravetz

Comments

Rodrigo Kravetz’s picture

Issue summary: View changes
shipra.wasson’s picture

Hi Rodrigo Kravetz,

Thanks for contributing.

I found some issues.
1) README.txt is missing.
2) Line no 40 function missions_page(). The comment is wrong it is not hook_page. There is no such hook.
Also all functions should be prefixed with your module name to avoid name clashes.
3) Pleae check http://pareview.sh/pareview/httpgitdrupalorgsandboxkravetz2452999git for more errors and warnings.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

kunalkursija’s picture

Status: Needs review » Needs work

Hey Rodrigo,

Your module needs to be worked on. There are few issues, please find the review below.

1) As Shipra Wasson mentioned, Readme.txt file is missing, So you must add that one straight away.

The template for README.txt file can be found HERE

2) Your module is not according to drupal coding standards, You should install CODER module and test the code format

3) URL callback name in module file is not standard. All functions should start with MODULENAME.

4) Your Git default branch is not set, You can check the DOCUMENTATION HERE

5) Pareview has generated lot of other errors, you can check them HERE

Kindly correct these.

Rodrigo Kravetz’s picture

Thank you, shipra. Thank you kunal.
I did the changes, however I'm not able to push anymore to the repository.

I'm getting the message:

fatal: unable to access 'http://git.drupal.org/sandbox/kravetz/2452999.git/': The requested URL returned error: 403

guptas89’s picture

Hi @Rodrigo Kravetz

I think you have clone the repository from public URL. Please try below steps:

- Goto 'your projects' tab page then click on your project link i.e united_nations_peacekeeping_operations
- Click on 'version control' tab, you will see a code block with heading 'Setting up repository for the first time' like:

git clone --branch [your branch] [your username]@git.drupal.org:sandbox/[your git username]/[project nod id].git united_nations_peacekeeping_operations

- Clone using git url mentioned in code block.
- Do you file changes.
- Commit and push.

I hope you will be able to push your changes to follow the above steps.

jyotisankar’s picture

Hi Rodrigo Kravetz
Thanks for your contribution.
I think you have not reviewed your project in http://pareview.sh. There are lots of error in the module.
To reproduce/get the error, please open http://pareview.sh in your browser than add http://git.drupal.org/sandbox/kravetz/2452999.git in the text box. After that once you click on "Submit branch" button you can see the errors.
Thanks

Rodrigo Kravetz’s picture

Thank you everybody.
For some reason the SSH keys, that were working, are not working anymore.
Therefore I deleted my private and public keys and now I'm able to update the repository providing my username and password constantly.

I fixed the coding issues, I hope the module now will work fine.

Honestly, I would like to work more on the code itself than working on spaces at end of lines and etc., but I understand theses code standards enhance professionalism on development.

Rodrigo Kravetz’s picture

Status: Needs work » Needs review
hussainweb’s picture

Status: Needs review » Needs work

Thank you for your contribution. I suspect you are already working on errors by pareview. I only saw extra space in beginning of the file and you can consider removing that.

I see you are using libxml_set_streams_context() which needs libxml. I believe this is not one of Drupal's requirements which means you should document this requirement and also write a hook_requirements for this. Alternatively, you can switch to use XML extension which is required by Drupal and is sure to be installed.

  // Request the XML of peacekeeping operations.
  $xmldoc = new DOMDocument();

  $xmldoc->load('http://www.un.org/en/peacekeeping/includes/map.xml');

  $missions = $xmldoc->getElementsByTagName('operation');

  foreach ($missions as $mission) {
    ...

I believe you should check for errors here. I realize that foreach would not execute in case of an error but it would get difficult to trace if missing output means no data or an error.

  foreach ($missions_array as $pko) {

Nitpick: If there are no results, or there was an error, $missions_array could be NULL and this would generate a warning. You should fix this by initializing $missions_array to an empty array outside the foreach loop.

    $vetor = array();

Nitpick: I am not sure what $vetor means (is it another language?). Consider renaming.

  foreach ($missions_array as $pko) {
    $output .= t("<h1>@acronym</h1>\r\n", $pko);
    $output .= t("<p>@name</p>\r\n", $pko);
    $output .= t("<p><b>Region: @region</b></p>\r\n", $pko);
    $output .= t("<a href='@link'>@link</a>\r\n", $pko);
  };

It is not a good idea to construct output this way. You should use theme() function to generate the output.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.