The default list of excluded paths for PURL can require some customization.

'features', 'features/*', 'admin', 'admin/*'

In our case, payment providers doesn't work in spaces and excluding it (by adding cart) helps remind us when we break links, while view_ui is often nice to visit inside of a space (admin/build/views).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

glennpratt’s picture

This patch just checks for a variable (and deletes it on uninstall, which might be overkill since I don't ever create it).

glennpratt’s picture

Status: Active » Needs review

Oh yeah, needs review...

jmiccolis’s picture

Priority: Normal » Critical

Bumping the priority of this one. I'm not sure I like using a variable to store this stuff, but I can see the need to have a way to change these paths.

glennpratt’s picture

How about a drupal_alter() over a variable_get()?

Modules would implement something like hook_spaces_purl_excluded_paths_alter().

If so, I'll try to re-roll.

jmiccolis’s picture

Status: Needs review » Fixed

So, I took another look here and currently to do this by extending a Space type class, and altering the registry.

For example you could extend `space_og` and then implement `hook_spaces_registry_alter()` to have all OG spaces use your class and not the default one.

Does that work for you?

randallknutson’s picture

It is very nice on a development server to be able to disable this for "admin" when developing views. This allows us to test a view in preview while inside a space. It is a little weird but works. Essentially we comment out the line with "admin" and then go to {url}/{purl}/admin/build/views/edit/{viewname}

I'd also find this very useful if we could add additional paths like the payment processor and ajax callbacks that tend to break within spaces. Variables seem like a good way to do this as it will probably need to be fairly variable.

Status: Fixed » Closed (fixed)

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

glennpratt’s picture

Status: Closed (fixed) » Active
FileSize
2.28 KB

This doesn't really work cleanly, since we use more than one space, and it would be messy to maintain, especially for a contrib module.

If you are confident this won't change, we will implement as you suggest.

Re-roll attached.

glennpratt’s picture

Whoops, extra patch in there.

christianchristensen’s picture

subscribe - this is invaluable for debugging/working with views in spaces!

hefox’s picture

Invisible variables are a bit meh. This should likely have a settings page. However, the information would likely be stored in a string instead of an array in that case unless the submission is handled custom (ie not using system_settings_form).

static $paths;
if (!isset($paths)) {
  $paths = explode("\n", variable_get ... );
}
return $paths;

Other than that, agree that it would be a useful functionality for features to have out of the box; I can think of a few paths I'd want to exclude.

edit: I disagree with myself; whatever the setting form is, as long as it doesn't use system_settings_form, it can do the explode then variable_set there. screw exploding on each check.

Grayside’s picture

drupal_match_path() will process a string a la block visibility paths with no explosions anywhere.

glennpratt’s picture

Yeah, for consistency, I would probably move this to drupal_match_path() if we wan't to expose it, then it would work like the block and context path settings.

hefox’s picture

Status: Active » Needs work
Grayside’s picture

Also, I'm not sure if you should allow anyone to remove the existing blacklisted paths. Those should perhaps be added to whatever the variable contains.

hefox’s picture

Someone expressed the desire to remove /admin temporarily; it seems with enough warning that it is desired

Grayside’s picture

Maybe control over the cooked in paths should be done via separate UI, such as checkboxes. That way you can provide the option, but not risk a misclick delete creating unexpected behaviors.

MrMaksimize’s picture

I like having the overrides in settings personally. that way they can be version controlled :)

Grayside’s picture

Status: Needs work » Needs review
FileSize
1.27 KB

Attached file is more or less a reroll of #9, except now it expects newline delimited paths as standard output from excluded_paths().

I was looking at how to provide a UI, and I'm thinking this should go somewhere around admin/build/spaces. This seems like a confusing and therefore dangerous setting to expose at /features. As there is no facility for spaces type plugins to introduce configuration, I stopped there. And added #1327092: Add a Spaces configuration page for non-preset related settings.

pdrake’s picture

Version: 6.x-3.0-beta4 » 6.x-3.3
FileSize
2.1 KB

Attached is a re-roll of #19 against 6.x-3.3, integrated with the patch from http://drupal.org/node/933634#comment-5412508. The reason I integrated these two patches is that the issues are related and touch the same lines of code.

pdrake’s picture

In the above patch, I overlooked the incompatibility between the patch from issue #933634 and the change in #19 to a string with newline separators. That change is also incompatible with class space_og, so this patch changes the return from excluded_paths back to an array.

pebosi’s picture

Version: 6.x-3.3 » 6.x-3.6

Is there any reason to dont allow "admin" path's on a space? Or why we should not simply remove "admin" and "admin/*" from the returned array?

Regards