One of my latest pet annoyances, while the addition of the 'Add site' and 'Add platform' local tasks are great, I find myself inside a Platform node wondering why I can't add a new site into this platform.

Patch attached in comment #1.

Comments

deciphered’s picture

Status: Active » Needs review
StatusFileSize
new5.06 KB
deciphered’s picture

StatusFileSize
new1008 bytes
new5.31 KB

Fixed an issue when testing in a real Aegir setup instead of just a test Aegir setup.

Take into account, I'm not all that happy with the approaches taken in these patches, but then I do think the whole AJAX stuff needs to be completely re-written as well, and that the additional Node add tabs should be provided by the Contextual Administration modle.... so with that said, I think what has been done is good enough for the moment.

deciphered’s picture

anarcat’s picture

this belongs to hosting.

helmo’s picture

Nice, this is something I've wondered about... why didn't we have this before ...

Some remarks:

+++ b/modules/hosting/site/hosting_site.form.inc
@@ -125,10 +125,16 @@ function hosting_site_available_options($node) {
     $allowed_plats = _hosting_get_allowed_platforms($user->uid);
+    if (!is_null($platform)) {
+      $allowed_plats = array($platform => $platform);

The first call to _hosting_get_allowed_platforms() is only needed if (is_null($platform)). '$allowed_plats = array($platform => $platform);' could be in the else.

+++ b/modules/hosting/site/hosting_site.module
@@ -58,6 +58,15 @@ function hosting_site_menu() {
 
+  $items['node/%node/add'] = array(
+    'title' => 'Add site',
+    'type' => MENU_LOCAL_TASK,
+    'page callback' => 'hosting_site_add_by_platform',
+    'page arguments' => array(1),
+    'access callback' => 'hosting_site_add_by_platform_access',
+    'access arguments' => array(1),
+  );

This path seems a bit to generic to my liking....

hosting_site.module uses node/%node/site/add

Ideally this would follow the same pattern, but that would probably be too much effort for this feature.
What about 'node/%node/platform-add-site'?

anarcat’s picture

Status: Needs review » Needs work

agreed.

deciphered’s picture

helmo’s picture

Status: Needs review » Needs work

Darn... merge conflict

deciphered’s picture

Status: Needs work » Needs review
helmo’s picture

Status: Needs review » Fixed

Merged, thanks

Status: Fixed » Closed (fixed)

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

  • Commit 726b4ba on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x authored by Deciphered, committed by helmo:
    Issue #1988642 by Deciphered: Added site by platform.
    

  • Commit 726b4ba on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x authored by Deciphered, committed by helmo:
    Issue #1988642 by Deciphered: Added site by platform.