I have a feature for all of my pathauto patterns with the default pattern set to "[node:menu-link:parent:url:alias]/[node:title]" so the strongarm in code is:

  $strongarm = new stdClass;
  $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
  $strongarm->api_version = 1;
  $strongarm->name = 'pathauto_node_pattern';
  $strongarm->value = '[node:menu-link:parent:url:alias]/[node:title]';
  $export['pathauto_node_pattern'] = $strongarm;

This feature is in an install profile, and when I create a site using the profile all pathauto patterns (that are also in the same feature) are correctly imported but the default pattern goes back to content/[node:title].

Has anyone else come across something like this? It seems to be a strange bug but is very frustrating for me as I need my aliases to be correct on install.

Cheers,
Adam

Comments

dave reid’s picture

This is because Pathauto sets default variables in pathauto_install(). Likely it's a features bug where it can't override variables set in install.

acbramley’s picture

Pathauto is enabled long before the feature is in the install profile though. Surely a variable doesn't get special treatment just because it's set on install.

dave reid’s picture

Category: bug » support

Moving to a support request until we can figure out what the actual bug is.

tsvenson’s picture

This happens for normal features as well. Just create a feature that enables Pathauto with a few of its settings changed. Then Features will detect those as overridden values and you will have to manually fix it right after enabling it.

Not sure I have seen any other module, of those I use, who behaves like this though.

velocis’s picture

Issue summary: View changes

I know this is an old post, I just ran into this issue when creating a new module and deploying it on another system.
I found that it created the fields to hold the patterns in url alias, but the defaults where not there.
I then did a drush rr and when I went back to the url alias screen the pattern was there.

this is what my modules strongarm file entry looks like

  $strongarm = new stdClass();
  $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
  $strongarm->api_version = 1;
  $strongarm->name = 'pathauto_node_mycontenttype_pattern';
  $strongarm->value = 'mycontenttype/[node:field_publication]/[node:title]';
  $export['pathauto_node_mycontenttype_pattern'] = $strongarm;
mably’s picture

Status: Active » 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.