Hi,

I am building a community website programmatically, therefore most of the configuration is done through modules (setting variables, creating default content, etc.)

Would it be possible in pathauto.install, function pathauto_install() to setup the default variables (patterns, etc.) only if they do not exists yet. Currently pathauto simply dump its default value without caring for existing ones. It is not a big change, and it would certainly make life easier for a couple of people like me who are using drupal as a framework.

The simple way to achieve that is to replace instructions like this one:

  variable_set('pathauto_node_pattern', 'content/[node:title]');

by

  $v = variable_get('pathauto_node_pattern', 'content/[node:title]');
  variable_set('pathauto_node_pattern', $v);

I should be able tp provide a patch if required.

Cheers,

Sylvain

Comments

dave reid’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.33 KB

I think this should probably work.

Status: Needs review » Needs work

The last submitted patch, 1430898-pathauto-default-variables-play-nice.patch, failed testing.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB

Without a spelling error this time.

spouilly’s picture

Status: Needs review » Reviewed & tested by the community

Patch #3 get the job done for me.

dave reid’s picture

  • Dave Reid committed 1c0db44 on
    Issue #1430898 by Dave Reid: Fixed pathauto_install() should not...

  • Dave Reid committed 4966ef2 on
    Issue #1430898 by Dave Reid: Fixed pathauto_install() should not...
dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed #3 to 7.x-1.x.

Status: Fixed » Closed (fixed)

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