1. create a taxonomy space
  2. go to "Features" tab
  3. set the drop down menu "Default front page" to "Other..."
  4. set internal drupal path eg. "node/1234" at "A relative path"
  5. go to the front page of the taxonomy space

Result: Showing the default front page of the website instead of the chosen node.

I found a TODO in spaces_controller_variable.inc in the function init_overrides() .

    // If we have overridden 'site_frontpage', we need to do some extra
    // work to reinit the drupal path.
    // TODO: Is purl_language_strip still needed?
    //if ($this->get('site_frontpage') !== $this->get('site_frontpage', 'original') && function_exists('purl_language_strip')) {
    //  $_GET['q'] = purl_language_strip($_REQUEST['q']);
    //  drupal_path_initialize();
    //}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iSoLate’s picture

Status: Active » Needs review
FileSize
1.18 KB

I created an initial patch. This covers only spaces_taxonomy.

pfrenssen’s picture

Status: Needs review » Needs work

This only works for paths that do not end in a slash. To support paths ending in a slash as well:

-    if ($uri == $_SERVER['REQUEST_URI']) {
+    if ($uri == rtrim($_SERVER['REQUEST_URI'], '/')) {
sandervd’s picture

Status: Needs work » Needs review
FileSize
1.3 KB

A bit more generic approach: Call drupal_path_initialize when the variables controller is loaded. Sets the frontpage correctly for all spaces types.

pfrenssen’s picture

Status: Needs review » Needs work

Patch from #4 looks promising but I'm encountering some problems:

  • When the front page is still set to the default value ('node') this does not work. $this->get('site_frontpage', 'original') returns NULL until it is manually resaved in the default features variable settings at the path /features. There are instructions at /admin/config/system/site-information but this should really work out of the box without manual intervention.
    "The front page is controlled by the spaces module and can be set here."
  • When visiting the front page of a space I get a notice:
    Notice: Undefined index: q in spaces_controller_variable->init_overrides() (line 35 of sites/all/modules/patched/spaces/plugins/spaces_controller_variable.inc).
pfrenssen’s picture

Status: Needs work » Needs review
FileSize
1.46 KB

Addressed the problems from #5.

kristiaanvandeneynde’s picture

Issue summary: View changes
Status: Needs review » Closed (works as designed)

This is actually a problem in PURL, not Spaces. Fixed in #2599098: PURL activated too late..

(Although I'm all for removing the commented out code which is now obsolete.)