How to define settings from an install profile

JOSE MANUEL VELASCO <[email protected]> Thu, 26 Feb 2015 11:49:32 +0000
Newsgroups gmane.comp.php.drupal.devel
Message-ID <[email protected]>
--_000_7B7BA5CE3DACF842ABB1E829F53DF3A65CD779YLAV2300INETPSAco_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I am looking for the way to make some commong settings for my Project in th=
e install profile but I can't achieve.

I have post the question in drupalexchange, which you can read following th=
is link:
http://drupal.stackexchange.com/questions/149730/how-to-define-settings-fro=
m-an-install-profile?noredirect=3D1#comment179419_149730

And I am pasting here as well:


I am looking for the way to set some settings at the install step.

EDIT: Here is my current try: https://gist.github.com/anonymous/b950eacc3ca=
80159628b

At profile_final() function, where as I understood all drupal is bootstrape=
d I have:

  variable_set('date_first_day', 1);

But the regional setting for the first day of the week still is Sunday afte=
r the installation. So it is not working as I expected.

I am using the taxonomy_menu module, and I would like to set at the install=
ation step the menu to be linked with the taxonomy. Because I am installing=
 something known, I know the variable names that might be set are:

variable_set('taxonomy_menu_vocab_menu_rubric', 'menu-genius-navigation-men=
u');

variable_set('taxonomy_menu_vocab_parent_rubric', 0);

This is not working neither.

I have been following https://www.drupal.org/node/1022020

and looking at other examples but I have had no luck to find how to do this=
.

Is it possible to do whatever setting in an install profile or are there an=
y restriction? In that case, what restrictions are?

What am I doing wrong?

I'll appreciate any kind of comments.

Thanks for the reading.



Regards,

J. Manuel

--_000_7B7BA5CE3DACF842ABB1E829F53DF3A65CD779YLAV2300INETPSAco_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML con formato previo Car";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Texto de globo Car";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	mso-fareast-language:EN-US;}
span.EstiloCorreo17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.TextodegloboCar
	{mso-style-name:"Texto de globo Car";
	mso-style-priority:99;
	mso-style-link:"Texto de globo";
	font-family:"Tahoma","sans-serif";}
span.apple-converted-space
	{mso-style-name:apple-converted-space;}
span.HTMLconformatoprevioCar
	{mso-style-name:"HTML con formato previo Car";
	mso-style-priority:99;
	mso-style-link:"HTML con formato previo";
	font-family:"Courier New";
	mso-fareast-language:ES;}
span.pln
	{mso-style-name:pln;}
span.pun
	{mso-style-name:pun;}
span.str
	{mso-style-name:str;}
span.lit
	{mso-style-name:lit;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"ES" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-US">Hello,<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">I am looking for the way to mak=
e some commong settings for my Project in the install profile but I can&#82=
17;t achieve.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">I have post the question in dru=
palexchange, which you can read following this link:
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><a href=3D"http://drupal.stacke=
xchange.com/questions/149730/how-to-define-settings-from-an-install-profile=
?noredirect=3D1#comment179419_149730">http://drupal.stackexchange.com/quest=
ions/149730/how-to-define-settings-from-an-install-profile?noredirect=3D1#c=
omment179419_149730</a><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">And I am pasting here as well:<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">I am looking for the way to set s=
ome settings at the install step.<o:p></o:p></span></p>
<p style=3D"margin:0cm;margin-bottom:.0001pt;line-height:13.65pt;background=
:white;vertical-align:baseline;orphans: auto;widows: auto;-webkit-text-stro=
ke-width: 0px;word-spacing:0px">
<strong><span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Ve=
rdana&quot;,&quot;sans-serif&quot;;color:#444444;border:none windowtext 1.0=
pt;padding:0cm">EDIT</span></strong><span lang=3D"EN-US" style=3D"font-size=
:10.5pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44444=
4">:
 Here is my current try:</span><span class=3D"apple-converted-space"><span =
lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&quot;,&q=
uot;sans-serif&quot;;color:#444444">&nbsp;</span></span><span style=3D"font=
-size:10.5pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#=
444444"><a href=3D"https://gist.github.com/anonymous/b950eacc3ca80159628b">=
<span lang=3D"EN-US" style=3D"color:#349EDF;border:none windowtext 1.0pt;pa=
dding:0cm">https://gist.github.com/anonymous/b950eacc3ca80159628b</span></a=
></span><span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Ve=
rdana&quot;,&quot;sans-serif&quot;;color:#444444"><o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">At profile_final() function, wher=
e as I understood all drupal is bootstraped I have:<o:p></o:p></span></p>
<pre style=3D"background:#F3F3F3;vertical-align:baseline;max-height: 600px;=
border-radius: 3px;word-wrap: normal;orphans: auto;widows: auto;-webkit-tex=
t-stroke-width: 0px;overflow:auto;word-spacing:0px"><span class=3D"pln"><sp=
an lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:black=
;border:none windowtext 1.0pt;padding:0cm">&nbsp; variable_set</span></span=
><span class=3D"pun"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-fam=
ily:Consolas;color:#145680;border:none windowtext 1.0pt;padding:0cm">(</spa=
n></span><span class=3D"str"><span lang=3D"EN-US" style=3D"font-size:9.0pt;=
font-family:Consolas;color:maroon;border:none windowtext 1.0pt;padding:0cm"=
>'date_first_day'</span></span><span class=3D"pun"><span lang=3D"EN-US" sty=
le=3D"font-size:9.0pt;font-family:Consolas;color:#145680;border:none window=
text 1.0pt;padding:0cm">,</span></span><span class=3D"pln"><span lang=3D"EN=
-US" style=3D"font-size:9.0pt;font-family:Consolas;color:black;border:none =
windowtext 1.0pt;padding:0cm"> </span></span><span class=3D"lit"><span lang=
=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:#953838;bord=
er:none windowtext 1.0pt;padding:0cm">1</span></span><span class=3D"pun"><s=
pan lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:#145=
680;border:none windowtext 1.0pt;padding:0cm">);</span></span><span lang=3D=
"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:#393318"><o:p><=
/o:p></span></pre>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">But the regional setting for the =
first day of the week still is Sunday after the installation. So it is not =
working as I expected.<o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">I am using the taxonomy_menu modu=
le, and I would like to set at the installation step the menu to be linked =
with the taxonomy. Because I am installing something known,
 I know the variable names that might be set are:<o:p></o:p></span></p>
<pre style=3D"background:#F3F3F3;vertical-align:baseline;max-height: 600px;=
border-radius: 3px;word-wrap: normal;orphans: auto;widows: auto;-webkit-tex=
t-stroke-width: 0px;overflow:auto;word-spacing:0px"><span class=3D"pln"><sp=
an lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:black=
;border:none windowtext 1.0pt;padding:0cm">variable_set</span></span><span =
class=3D"pun"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Con=
solas;color:#145680;border:none windowtext 1.0pt;padding:0cm">(</span></spa=
n><span class=3D"str"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-fa=
mily:Consolas;color:maroon;border:none windowtext 1.0pt;padding:0cm">'taxon=
omy_menu_vocab_menu_rubric'</span></span><span class=3D"pun"><span lang=3D"=
EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:#145680;border:n=
one windowtext 1.0pt;padding:0cm">,</span></span><span class=3D"pln"><span =
lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:black;bo=
rder:none windowtext 1.0pt;padding:0cm"> </span></span><span class=3D"str">=
<span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:ma=
roon;border:none windowtext 1.0pt;padding:0cm">'menu-genius-navigation-menu=
'</span></span><span class=3D"pun"><span lang=3D"EN-US" style=3D"font-size:=
9.0pt;font-family:Consolas;color:#145680;border:none windowtext 1.0pt;paddi=
ng:0cm">);</span></span><span class=3D"pln"><span lang=3D"EN-US" style=3D"f=
ont-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0p=
t;padding:0cm"><o:p></o:p></span></span></pre>
<pre style=3D"background:#F3F3F3;vertical-align:baseline"><span class=3D"pl=
n"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color=
:black;border:none windowtext 1.0pt;padding:0cm">variable_set</span></span>=
<span class=3D"pun"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-fami=
ly:Consolas;color:#145680;border:none windowtext 1.0pt;padding:0cm">(</span=
></span><span class=3D"str"><span lang=3D"EN-US" style=3D"font-size:9.0pt;f=
ont-family:Consolas;color:maroon;border:none windowtext 1.0pt;padding:0cm">=
'taxonomy_menu_vocab_parent_rubric'</span></span><span class=3D"pun"><span =
lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:#145680;=
border:none windowtext 1.0pt;padding:0cm">,</span></span><span class=3D"pln=
"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;color:=
black;border:none windowtext 1.0pt;padding:0cm"> </span></span><span class=
=3D"lit"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas=
;color:#953838;border:none windowtext 1.0pt;padding:0cm">0</span></span><sp=
an class=3D"pun"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:=
Consolas;color:#145680;border:none windowtext 1.0pt;padding:0cm">);</span><=
/span><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:Consolas;co=
lor:#393318"><o:p></o:p></span></pre>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">This is not working neither.<o:p>=
</o:p></span></p>
<p style=3D"margin:0cm;margin-bottom:.0001pt;line-height:13.65pt;background=
:white;vertical-align:baseline;orphans: auto;widows: auto;-webkit-text-stro=
ke-width: 0px;word-spacing:0px">
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">I have been following</span><span=
 class=3D"apple-converted-space"><span lang=3D"EN-US" style=3D"font-size:10=
.5pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#444444">=
&nbsp;</span></span><span style=3D"font-size:10.5pt;font-family:&quot;Verda=
na&quot;,&quot;sans-serif&quot;;color:#444444"><a href=3D"https://www.drupa=
l.org/node/1022020"><span lang=3D"EN-US" style=3D"color:#349EDF;border:none=
 windowtext 1.0pt;padding:0cm">https://www.drupal.org/node/1022020</span></=
a></span><span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;V=
erdana&quot;,&quot;sans-serif&quot;;color:#444444"><o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">and looking at other examples but=
 I have had no luck to find how to do this.<o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">Is it possible to do whatever set=
ting in an install profile or are there any restriction? In that case, what=
 restrictions are?<o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">What am I doing wrong?<o:p></o:p>=
</span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span lang=3D"EN-US" style=3D"font-size:10.5pt;font-family:&quot;Verdana&qu=
ot;,&quot;sans-serif&quot;;color:#444444">I'll appreciate any kind of comme=
nts.<o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline;=
orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px"=
>
<span style=3D"font-size:10.5pt;font-family:&quot;Verdana&quot;,&quot;sans-=
serif&quot;;color:#444444">Thanks for the reading.<o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline"=
>
<span style=3D"font-size:10.5pt;font-family:&quot;Verdana&quot;,&quot;sans-=
serif&quot;;color:#444444"><o:p>&nbsp;</o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline"=
>
<span style=3D"font-size:10.5pt;font-family:&quot;Verdana&quot;,&quot;sans-=
serif&quot;;color:#444444">Regards,<o:p></o:p></span></p>
<p style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;ma=
rgin-left:0cm;line-height:13.65pt;background:white;vertical-align:baseline"=
>
<span style=3D"font-size:10.5pt;font-family:&quot;Verdana&quot;,&quot;sans-=
serif&quot;;color:#444444">J. Manuel<o:p></o:p></span></p>
</div>
</body>
</html>

--_000_7B7BA5CE3DACF842ABB1E829F53DF3A65CD779YLAV2300INETPSAco_--