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
Comment #1
dave reidThis is because Pathauto sets default variables in pathauto_install(). Likely it's a features bug where it can't override variables set in install.
Comment #2
acbramley commentedPathauto 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.
Comment #3
dave reidMoving to a support request until we can figure out what the actual bug is.
Comment #4
tsvenson commentedThis 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.
Comment #5
velocis commentedI 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
Comment #6
mably commented