Commit 1be58fcf authored by Fran Garcia-Linares's avatar Fran Garcia-Linares Committed by Neil Drumm
Browse files

Issue #3306964 by fjgarlin, drumm: Provide in-context help text on the new...

Issue #3306964 by fjgarlin, drumm: Provide in-context help text on the new release form to explain when to use patch vs minor vs major releases
parent f1e6da6b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -830,6 +830,15 @@ function drupalorg_project_form_node_form_alter(&$form, &$form_state) {
    }
    $release_type_field[$insecure_term->tid]['#description'] = check_markup($insecure_term->description, $insecure_term->format);
    if (empty($form['nid']['#value'])) {
      // If there are no options, a warning message is shown instead.
      if (count($form['field_release_vcs_label'][LANGUAGE_NONE][0]['value']['#options']) > 1) {
        // Help text to explain when to use patch vs minor vs major releases.
        $msg = '<strong>' . t('Information about branches and tags') . '</strong>';
        $msg .= '<p>' . t('Your release needs to have a tag or branch that follows the <a href="http://drupal.org/node/1015226">naming conventions</a>.') . '</p>';
        $msg .= '<p>' . t('For more information, see <a href="http://drupal.org/node/1066342">Creating a Tag or Branch in Git</a> or the <a href="@git_instructions_url">Git instructions</a> page for your project.', ['@git_instructions_url' => url('node/' . $project->nid . '/git-instructions')]) . '</p>';
        drupal_set_message($msg);
      }

      // Adding a new release.
      array_unshift($form['#validate'], 'drupalorg_project_new_release_validate');
      $form['field_release_vcs_label'][LANGUAGE_NONE][0]['value']['#element_validate'][] = 'drupalorg_project_conflicting_versions_form_validate';