Create and translate is a module that adds a submit button on the node add form to create the node and go directly to the translation page.
On the creation of the node, the button will only show up when selecting a language.

Creating nodes with translations is a lot more fun and less clicks with this module.

While adding a translation, there will appear a button to create the node and go back to translations.

There's a settings-form available where you can enable/disable this feature by content type.
There are permissions to enable the use of this feature by role.

https://www.drupal.org/sandbox/stijnstroobants/2438149

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/StijnStroobants/2438149.git create_and_translate

Manual reviews
https://www.drupal.org/node/2661410#comment-10869846
https://www.drupal.org/node/2670510#comment-10869960

Comments

stijnstroobants’s picture

Issue summary: View changes
PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2438375

Project 2: https://www.drupal.org/node/2316793

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 ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxStijnStroobants243814...

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.

stijnstroobants’s picture

Fixed Pareview errors

stijnstroobants’s picture

Status: Needs work » Needs review
pratik.mehta19’s picture

Status: Needs review » Needs work

Hi StijnStroobants,

All contributed modules should provide a README.txt or README.md file in the package. This plain-text file should contain a basic overview of what the module does and how someone may use it.
The README-file should repeat the synopsis on the project page on Drupal.org.
If the README-file becomes large or complex, installation and configuration instructions may be moved into an additional file named INSTALL.txt or INSTALL.md. It would concentrate on the installation tasks: system requirements, installation instructions, frequently asked questions, etc.
Like module files, README, INSTALL and other plain text files should use unix-style line-endings (\n), and not windows (\r\n) or mac (\r) line endings.
The file should be formatted to hard-wrap at 80 characters.

pratik.mehta19’s picture

Git default branch is not set, see the documentation on setting a default branch (https://www.drupal.org/node/1659588).

stijnstroobants’s picture

Set default branch for project and added a README.txt

stijnstroobants’s picture

Status: Needs work » Needs review
drupalove’s picture

Automated Review

Automated test cases were found in the README.txt file, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or theREADME Template.
  1. The introduction should include a link to the project page and issue queue. If the project is a sandbox, these links should go to the sandbox until promotion.
  2. Make it clear in the description that the module requires the core modules locale and content translation to be enabled.
  3. Configuration and installation should be included (a section for each).
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
However, I think a second opinion is necessary, preferably by an administrator.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. (*) Create and add more translations takes to the translate listing page:
    /node/22/translate instead of /node/add/article?translation=22&target=en
    Therefore I suggest, you:
    - change the project description to:
    … and go directly to the translations list page.
    - change the button title from: Create and add more translations to: Add more translations
    - change the screenshot of the project accordingly.
  2. (*) For consistency, I think it is better to place the settings for enabling and creating translation page
    under 'Multilingual support' in the vertical tab 'Publishing options'.
  3. In create_and_translate.module file:
    - I think the first hook is not implementation of hook_form_FORM_ID_alter() but hook_form_BASE_FORM_ID_alter
    which is recommended for altering the form on the node edit page. Please make the necessary change.
    - Make the letter T lower case in Enable create and Translate for this content type?
  4. For the second hook in the same file:
    You may add additional details pertinent to the particular hook implementation:
    /**
    * Implements hook_form_FORM_ID_alter() for node_type_form().
    */
    function mymodule_form_node_type_form_alter(&$form, &$form_state) {

    See https://www.drupal.org/coding-standards/docs

  5. Provide help text in the Drupal UI.
    See https://www.drupal.org/node/161085#hook_help

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.

drupalove’s picture

Status: Needs review » Needs work
drupalove’s picture

@StijnStroobants, some useful links to the documentation were accidentally removed I'll list them here:

  1. Module documentation guidelines at: https://www.drupal.org/node/161085
  2. Readme template at: https://www.drupal.org/node/2181737
  3. Code long/complex enough for review at: https://groups.drupal.org/node/195848
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.

stijnstroobants’s picture

Fixed the review recommendations.

- Set module weight
- Moved the settings for enabling Create and translate under 'Multilingual support' in the vertical tab 'Publishing options'. Used conditional form element.
- Added hook_help

stijnstroobants’s picture

Status: Closed (won't fix) » Needs review
PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2438375

Project 2: https://www.drupal.org/node/2561969

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 ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

drupalove’s picture

@StijnStroobants please get a review bonus and add the PAReview: review bonus tag.

boromino’s picture

Status: Needs review » Needs work

Automated Review

Pareview and Coder: No issues found.

Manual Review

Code long/complex enough for review
No: Does not follow the guidelines for project length and complexity: The PHP/Javscript source code is less than 120 lines long
Coding style & Drupal API usage
  1. + Use LANGUAGE_NONE for 'und' in :input[name="language"]' => array('value' => 'und'). Same in
    :input[name="language_content_type"]' => array('value' => '2'): Use TRANSLATION_ENABLED for the value comparison.
  2. Document where to configure the content type settings to hook_help() and add, that the button only appears on content types multilingual with translations.
  3. + What is the purpose of $form_state['createandtranslate'] = $_GET['q'];? You don't seem to use it afterwards and it could be a security issue.
  4. + Replace variable_get('language_content_type_' . $form['#bundle']) == 2 by translation_supported_type($type)
  5. + // Set module weight: Set module after locale module weight.: You set a fixed weight, although claiming it should be higher than locale module weight. But you don't query for the locale module's weight.
  6. + Use same module name create_and_translate throughout your code, e.g. $form['actions']['createandtranslate'] vs $form['workflow']['create_and_translate_enabled']

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.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

stijnstroobants’s picture

Status: Needs work » Needs review
nitebreed’s picture

Hi Stijn,

Automated Review

No warnings / errors found (see http://pareview.sh/pareview/httpgitdrupalorgsandboxstijnstroobants243814...)

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
No: Does not follow the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. (+) Permission 'administer create and translate' isn't used anywhere?

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.

This review uses the Project Application Review Template.

tajinder.minhas’s picture

Status: Needs review » Needs work

Hello Stijn,

Following are the points which i was able to find

  1. "administer create and translate " permission is not being used anywhere, line 86 of create_and_translate.module
  2. You can break line 27 if condition so that it is more readable, just a formatting change
  3. if (translation_supported_type($form['#bundle']) </li>
      <li>  && variable_get('create_and_translate_enabled_' . $form['type']['#value']) == 1 </li>
      <li>  && user_access('translate content')) {
stijnstroobants’s picture

Thanks for the reviews again.
Just committed the changes.

stijnstroobants’s picture

Status: Needs work » Needs review
Rahul Seth’s picture

It seems quite ok.

Rahul Seth’s picture

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

Status: Reviewed & tested by the community » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2561969

Project 2: https://www.drupal.org/node/2438375

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 ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

stijnstroobants’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

Reopened... This is not a duplicate...?

klausi’s picture

please read the message of the bot, only one application per user should stay open.

stijnstroobants’s picture

Issue summary: View changes
stijnstroobants’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, Stijn!

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.

Status: Fixed » Closed (fixed)

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