The module is a new translation connector from Drupal 7 and 8 to XTM international via TM_GMT module.
XTM International is Translation Management System.
The goal of this connector is to send content from Drupal, translate it in XTM and and send back to translated content to Drupal.
For testing purpose, the XTM test account will be necessary. Please, let us know and we will provide one.
The documentation is attached.
Project link
https://www.drupal.org/project/tmgmt_xtm
Git instructions
git clone --branch 8.x-5.x https://git.drupal.org/project/tmgmt_xtm.git
PAReview checklist
https://pareview.sh/pareview/https://git.drupal.org/project/tmgmt_xtm.git
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | pareview.txt | 210.19 KB | klausi |
| xtm-drupal-connector-user-manual.x98708.pdf | 693.73 KB | pjassem | |
| xtm-connect-drupal-8.x98708.pdf | 1.69 MB | pjassem |
Comments
Comment #2
saesa commentedWhat is the difference with this module? https://www.drupal.org/project/tmgmt
We just review a single project, and a single branch. Choose the project/branch you want reviewed, and edit the title to reflect your choice. D7 o D8?
Comment #3
pjassem commentedOur module adds an another translation service provider for tmgmt.
It is working the similar way as other modules connected to TMGMT listed on page: https://www.drupal.org/project/tmgmt in the section: Translation Service Providers
We created two branches: one for D8: 8.x-5x and the second one for D7: 7.x-2x. Is there a problem with their names?
Please, review both branches.
Comment #4
avpadernoThank you for your contribution!
We just review a single project, and a single branch. Choose the project/branch you want reviewed, and edit the OP to reflect your choice.
Comment #5
pjassem commentedThanks for your help.
I have a problem with figuring out what should be my next step.
Do I have to write in comment which branch I want to be review or do I have to set it somehow in module settings?
If it the first option, please check below:
Project to review: tmgmt_xtm
Branches: 8.x-5.x and 7.x-2.x
Comment #6
saesa commentedWe can only check one branch.
Comment #7
pjassem commentedIn that case, please check:
Project to review: tmgmt_xtm
Branch: 8.x-5.x.
Comment #8
saesa commentedComment #9
pjassem commentedThere have been no comments for two weeks. I'm wondering if my plugin is in a review or additional actions are necessary from my side.
Comment #10
alexdmccabeYou can find the results of the automated report at https://pareview.sh/pareview/https-git.drupal.org-project-tmgmt_xtm.git-....
Looking over your code, I see some places that could use some improvement:
\Drupal\tmgmt_xtm\XtmTranslatorUi::buildConfigurationForm()has each element broken out into a separate method. That makes reading the form API components very difficult. I'd strongly recommend just putting the whole form into one method.\Drupal\tmgmt_xtm\RemoteCallbackController::callback()looks like it pulls a lot of data straight from$_REQUESTwithout sanitizing it. Please review https://www.drupal.org/docs/7/security/writing-secure-code/overview.\Drupal\tmgmt_xtm\Plugin\tmgmt\Translator\Connectorhas a few methods that use the error-suppressing@operator. I would try to avoid ever using that, or if you really must use it, document why in comments in the code.The use of namespaces is odd and inconsistent - for example, it seems like
\Drupal\tmgmt_xtm\Plugin\tmgmt\Translator\TMGMTXtmExceptionshould be\Drupal\tmgmt_xtm\Exception\TMGMTXtmException.I think once the coding standards issues are fixed (most of which can be fixed automatically by
phpcbf, a lot of this will clear up. For now, it needs some work.Comment #11
pjassem commentedFixed code according your suggestions.
PSR-2 and cleaned code has been added by phpcbf script.
Help documentation added.
Comment #12
klausiThanks for your contribution!
Review:
* README is empty, please fill it out
* info file: please remove the Drupal.org packaging block.
* Coding Standards: you use 4 space indentation and the opening braces should be on the same line. Please install Coder and fiy all your coding standard violations. https://www.drupal.org/project/coder
* drupal_set_message() is depreacted and must not be used anymore. Please use the appropriate service instead.
* "\Drupal::logger(self::XTM_LOGGER)->notice("XTM retrieveTranslation:" . GuzzleHttp\json_encode($fault));": do not concatenate variables into translatable log strings, use placeholders instead. Same for "drupal_set_message($error . ' ' . t('Please check the project in XTM for more details.')". Always use placeholders with t().
* Why do you need the unprotected /tmgmt_xtm_callback path? Please add a comment in the routing YAML file. As far as I can see this open callback is not a security issue because it then fetches something via SOAP and then processes that, so I guess that is ok?
* You use \Drupal all over the place, please use dependency injection instead. See https://www.drupal.org/docs/8/api/services-and-dependency-injection/serv...
* Do not use file_get_contents() to fetch remote files. Use Drupal's HTTP client instead.
So although there is quite a bit of wrong API usage as listed above I don't see a security issue, so I think we can approve this.
Automated review:
hook_help(). See https://www.drupal.org/docs/develop/documenting-your-project/module-docu... .This automated report was generated with PAReview.sh, your friendly project application review script.
Comment #13
avpadernoThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.
I thank all the dedicated reviewers as well.