User can select a node type and its filefield containing gpx data, and the module renames the waypoints in it to YYYY-MM-DD-number format.
Project page:
https://drupal.org/project/2163381/
Git repository:
https://drupal.org/project/2163381/git-instructions
Use: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/balagan/2163381.git gpx_rename
Code review: http://pareview.sh/pareview/httpgitdrupalorgsandboxbalagan2163381git
Added a sample gpx file (with .txt extension) for testing purposes.
Reviews of other projects
https://www.drupal.org/node/2335827#comment-9142631
https://www.drupal.org/node/2333083#comment-9143373
https://www.drupal.org/node/2129127#comment-9316717
Comment | File | Size | Author |
---|---|---|---|
teszt5.txt | 5.03 KB | balagan |
Comments
Comment #1
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxbalagan2163381git
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.
Comment #2
balagan CreditAttribution: balagan commentedComment #3
keopxHi,
You a have some error in your code and you need remove master branch.
Please see this link: http://pareview.sh/pareview/httpgitdrupalorgsandboxbalagan2163381git
Comment #4
balagan CreditAttribution: balagan commentedComment #5
balagan CreditAttribution: balagan commentedComment #6
balagan CreditAttribution: balagan commentedComment #7
balagan CreditAttribution: balagan commentedThanks,
Yes, indeed, the master branch was still an older version. I have deleted that now, and renamed 7.x.1.x to 7.x-1.x.
Nevertheless the git instructions were for the correct, default branch. Now only 1 branch remains.
Comment #8
keopxHi, you have a 2 errors, please check it : http://pareview.sh/pareview/httpgitdrupalorgsandboxbalagan2163381git
Comment #9
balagan CreditAttribution: balagan commentedOk, thanks, I will take a look at these 2 warnings tonight.
Comment #10
balagan CreditAttribution: balagan commentedBroke long comment into two lines, and removed unnecessary unset in ajax form.
Comment #11
maris.abols CreditAttribution: maris.abols commentedCode auto testing now seems fine.
I also installed module on fresh Drupal. Everything works as expected, but some short documentation is needed. Because only with third attempt I got waypoint names renamed. The right workflow that could be written in documentation:
1. Create file field for node.
2. Go to admin/config/gpx/gpx_rename and choose and save settings for this field.
3. Clear cache.
4. Create new node and upload test file.
Comment #12
balagan CreditAttribution: balagan commentedAhh, good idea, I was too busy with coding :)
Thanks for the advice.
Comment #13
balagan CreditAttribution: balagan commentedComment #14
balagan CreditAttribution: balagan commentedComment #15
balagan CreditAttribution: balagan commentedComment #16
keopxHi @balagan
You've some errors, please review this: http://pareview.sh/pareview/httpgitdrupalorgsandboxbalagan2163381git
Comment #17
balagan CreditAttribution: balagan commentedThanks for pointing out the errors, I have fixed them.
Comment #18
balagan CreditAttribution: balagan commentedComment #19
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@balagan, thankyou for your contribution.
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. None.
Manual Review
In this code, $cmt variable value is set that not declared outside this if condition and you are using this variable outside this if statement that completely break the logic of script.
Similar thing applied for $o variable, also variable names not convincing, you should use some meaningful name otherwise it is difficult to understand like
array_multisort($t, $n, $o);
. You should go through https://www.drupal.org/node/299070 again. I am unsure how PAreview can skip these.Personally I would suggest, you should report
drupal_set_message(t('Time is not set in the cmt element of a waypoint'));
these message in Drupal logs instead directly printing on screen.Also you are checking for valid file (
File is not a valid gpx file
) at later stage after$doc = new DOMDocument('1.0');
that producing following warning, if invalid file uploaded there.Warning: DOMDocument::load(): I/O warning : failed to load external entity "public://test%20Commands%20Useful%20for%20drupal.docx" in gpx_rename_rename_gpx() (line 80 of E:\xampp\htdocs\drupal730\sites\all\modules\2163381\gpx_rename.module).
You should check file type first and skip further process, if file format is invalid.
count($nids)
3 times in this function, can't you store count once and use that variable further, same for count($n) in gpx_rename_rename_gpx().<P> and </div
etc.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Nice to see, you are doing manual reviews, getting review bonus will help speed up review process for this application :)
Thanks again for your hard work.
Comment #20
balagan CreditAttribution: balagan commentedThanks for the review, my answers will follow shortly!
Comment #21
balagan CreditAttribution: balagan commentedI have changed the README.txt.
1. Fixed those issues, but still printing errors on screen, I think it is better to inform the user straight ahead, than to let them search for the cause of errors.
2. date_create_from_format was very comfortable, I have got rid of it.
3. Added hook_help() to display the README.txt.
4. This module actually will be part of a bunch of modules. It's hooks has to run before all other modules, because they actually change the file, the other modules parse and use this file. There was already a short comment about it in code.
5. As far as I know, it was already fixed. Maybe just locally? I don't know how you see this, maybe you did not pull the newest commit, or I forgot to push it. Now it should be fine.
6. Ok, using format_date now.
7. Fixed this, thanks for pointing this out.
8. Added missing t() functions.
9. Changed HTML tags to lowercase. I hope that is the way to go.
10. Edited project page.
Really thanks for pointing me out my mistakes! Actually the variable naming caused me some headaches too, when after a while I tried to touch my code. You seem to have a good eye to catch errors! Thanks a lot!
Comment #22
balagan CreditAttribution: balagan commentedComment #23
balagan CreditAttribution: balagan commentedChanged status, since the project application has been waiting over a month for review.
Comment #24
hawkeye.twolfMajor issues
Minor issues
Setting status to "needs work" only because the configuration page does not work correctly.
Comment #25
balagan CreditAttribution: balagan commentedThanks for the review Derek!
As for the hook_form_FORM_ID_alter(), according to the API its signature is right.
Nice catch with the instance deletion.
I hope to have fixed all issues (except git repo tag), and also added code to rename track names.
Comment #26
balagan CreditAttribution: balagan commentedComment #27
klausimanual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to heddn as he might have time to take a final look at this.
Comment #28
balagan CreditAttribution: balagan commentedI will follow your advice and make it work for entities in general.
gpx_parser is another module by me, and it has different submodules, one of it will be gpx_rename. Gpx rename works independently, so I choose this for project application for easier reviewing. I will check hook_module_implements_alter().
Thanks for reviewing.
Comment #29
heddnManual review:
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Comment #30
klausiI think that your only (*) item about field language does not warrant setting this back to needs work, since file fields are rarely translated this problem should not be a critical application blocker. Back to RTBC I guess?
Comment #31
heddnRTBC again. I was able to confirm that file fields are almost always LANGUAGE_NONE, even when content translation is enabled. A pretty specific set configuration is required to make a file translatable. However, a note should be added into module documentation mentioning the i18n limitation.
And since that was the last blocker...
Thanks for your contribution, Nagy Zsolt!
I updated your account so you can 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 stay 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.
Comment #32
balagan CreditAttribution: balagan commentedResponding to heddn's notes in comment 29:
1. I could not find "rame" in the README file, but corrected "modul".
2. I will try that, my gpx parser module requires that anyway.
3. I am planning to do that.
4. Ok, I have fixed that. When I did this, I was just keeping the 80 character/row limit in mind. The coding standards say in general lines should not be longer than 80 chars. What is the best practice for long translatable strings?
5. Ok, I will look into that.
6. Ok.
7. Yes, I will try to implement general entity support.
8. I saw in other modules that it is quite common to use LANGUAGE_NONE. In my case I think it does not really make sense to have different gpx filefields for different langauges, so I would skip it if possible. I see you guys also agreed already.
9. You are right. I have fixed that.
10. + I will definitely change it then. I have copied it from the image module. The image module only uses it for the same purpose, is there a reason why they chose field_read_field()? Is it worth opening an issue?
Thank you all for your help and effort, I appreciate it!
Comment #33
heddn#32.2: 80 characters applies to comments. Code itself can be longer than 80 characters. In general translatable strings should be logical chunks of data. Single words don't make sense, but neither does pages of text in one long t(). I tend to recommend a paragraph is the max length.
#32.8: Using entity module will resolve the issue as well.
#32.10: Depending on how that code is run, it might need an uncached copy of field info. I'm not sure in this case if it is necessary or not.