It would be great to have an Export/Import ability so that settings created on a dev server could be easily imported onto the production server.

CommentFileSizeAuthor
#6 pathauto.diff5.59 KBpifantastic

Comments

greggles’s picture

Version: 5.x-2.2 » 6.x-1.x-dev

Interesting idea. I'm not sure that this should be handled by Pathauto on its own, but instead by a module that does this in general.

That said, it could be good to implement the "variable dump" idea I had as a Pathauto setting export: #259949: Add text file export of Pathauto configuration for debugging

If this does happen, it's much more likely on the 6.x-2.x branch (which doesn't exist yet, so I'll set this to 6.x-1.x for now).

dave reid’s picture

Title: Export/Import setting » Support importing and exporting settings and patterns
Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Postponed

I think it would be much more appropriate to support a generalized import/export variable solution.

dave reid’s picture

This would be even easier if we stored the patterns and their options in the db like I'd like to start doing with #273104: Using "progressive disclosure" for alias patterns

designerbrent’s picture

Would this enable it to be use with the Features module for exporting path_alias patterns with an individual feature?

greggles’s picture

Title: Support importing and exporting settings and patterns » Store variables in our own place to make them more easily overridable/importable/exportable

I'm repurposing this a bit. I'd like us to move at least the "general settings" and the feed setting and whether feeds are enabled to a different place of storage than the variable table (or maybe stored there, but just as a tree).

I also think we should refactor the code in this area a bit:

Our current pattern:


// Current:

function pathauto_clean_token_values($full) {
  // Get a list of tokens
  // Foreach it.
  // Call pathauto_cleanstring on it.
  $replacements[$token] = pathauto_cleanstring($value);

  return $replacements;
}

function pathauto_cleanstring($string) {

  // Use lots of variable_gets to find variables.
  // Do text cleaning based on those variables.

}

A better pattern:


// Proposed

function pathauto_clean_token_values($full) {
  // Load all the variables related to cleanstring.
  $configuration = pathauto_get_configuration_cleanstring();
  drupal_alter('pathauto_cleanstring_variables_alter', $configuration);

  // Get a list of tokens
  // Foreach it.
  // Call pathauto_cleanstring on it.
  $replacements[$token] = pathauto_cleanstring($value, $configuration);

  return $replacements;
}

function pathauto_cleanstring($string, $configuration) {

  // Use lots of variable_gets to find variables.
  // Do text cleaning based on those variables.

}

I'm repurposing this issue since it's the most related.

#686234: Re-architect alias transformations
#273104: Using "progressive disclosure" for alias patterns

have interconnected ideas.

pifantastic’s picture

StatusFileSize
new5.59 KB

Here is my crack at this (with help from greggles).

With this patch, pathauto variables are stored in a separate function and can be overridden when calling pathauto functions. This patch is against 6.x-1.3 but should communicate the general idea.

greggles’s picture

Status: Postponed » Needs review

This patch works for me and seems like it should make our lives easier as we head toward the final goal in this issue. I think we should commit it as an interim step.

dave reid’s picture

Status: Needs review » Needs work

Yeah this would need to be rolled against the latest D7 and D6-2 branches. This wouldn't be appropriate for the 6.x-1.x branch.

pifantastic’s picture

Great. I will find time in the near future to roll a patch against the D7 and D6-2 branches.

dave reid’s picture

I'll try to give a higher-level review later tonight as well.

designerbrent’s picture

Wondering if this will get in...

mably’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.