Using the latest Aegir install (latest provision (provision-0.4-alpha5), drush (3.0-beta1), drush_make (2.0-beta6) and aegir (0.4 alpha 5) with all the correct modules)
When trying to save an existing site node (to add a redirection), it complains "You have not specified a valid port for this site."
Anyone encountered this? The port is just fine, says 80, db looks fine, it installed fine when I entered the info during the node creation, site works.

Comments

robin van emden’s picture

Found the solution to this problem:

In a recent migration, for some reason there was no "default platform" defined any more.

Since the code uses this info this when creating the "port" form element, this broke the site form.

Relevant code:

function _hosting_site_form_port($platform = HOSTING_DEFAULT_PLATFORM) {
  $showports = _hosting_site_allowed_ports($platform);
  $defport = reset($showports);
  if (sizeof($showports) > 1 && user_access('change site port')) {
    $form['port'] = array(
      '#type' => 'radios',
      '#title' => t('Port'),
      '#required' => TRUE,
      '#default_value' => $defport,
      '#options' => $showports,
      '#weight' => 5,
      '#attributes' => array('class' => "hosting-site-form-port-options"),
     );
  } else {
      $form['port'] = array('#type' => 'hidden', '#default_value' => $defport, '#attributes' => array('class' => "hosting-site-form-port-options"));
  }
  return $form['port'];
}

Might also, in general, be useful to check for a default platform show a warning if it isn't there?

butler360’s picture

So how did you fix this? I'm getting the same issue with alpha6.

Edit: Spoke too soon. You edit the platform you want to be the default and there's a checkbox there to make it the default. After that I can add aliases again. Thanks for spotting this problem!

Ian Ward’s picture

Status: Active » Needs review

I believe the actual bug is not calling _hosting_site_form_port() with $node->platform here:

else {
    $form['info']['platform'] = array(
      '#type' => 'item',
      '#title' => t('Platform'),
      '#value' => _hosting_node_link($node->platform),
     );
    $form['platform'] = array('#type' => 'hidden', '#value' => $node->platform);
    $form['info']['port'] = array(
      '#type' => 'item',
      '#title' => t('Port'),
      '#value' => $node->port,
     );
    $form['port'] = _hosting_site_form_port();

See the last line there - which should be called like:

$form['port'] = _hosting_site_form_port($node->platform);
adrian’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

  • Commit d615b68 on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by adrian:
    Remember the port setting on future form submissions. #724182
    

  • Commit d615b68 on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by adrian:
    Remember the port setting on future form submissions. #724182