Not sure why. I have other code that is working just fine (I'm creating a vocabulary). I'd like to set variables but don't want to strongarm users of my module, just set it up a default way and let them modify things if they want.

Comments

slip’s picture

I just made a feature which does a bunch of variable_set() calls in hook_install()

For example:
variable_set('ant_pattern_about_content', 'About page [nid]');

Works for me. Not sure what your problem might be. You're trying to do it in hook_install() ?

yhahn’s picture

Assigned: Unassigned » yhahn
Status: Active » Postponed (maintainer needs more info)

Kyle, if you're comfortable posting your hook_install() code that would definitely help.

kyle_mathews’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Hmmm... not sure what I was doing wrong before but I had a chance again today to look at the issue, did some variable_sets and it worked perfectly.

alexkb’s picture

I've implemented an install script in my feature, but I'm stuck on how to run it? i.e. if I go to /update.php it doesn't list the module, so even if it exists, I can't tell it to run my changes in the .install script.

alexkb’s picture

Looks like, if you have a module installed already, it will only detect database changes, if you have a _update_ function in your .install file. Sorry about that.

Another tip for people, is to avoid uppercase in your module name too, as discussed here.