Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have made a simple package, it installs fine, but in one macro i have made my own macro property that also works fine but I can not get it to install the macro properties.
In the package XML the line adding the property looks like this:
<property name="Color Scheme" alias="ColorScheme" show="True" propertyType="puginValueTypePicker" />
And in the Actions i do a DB install:
<Action runat="install" undo="false" alias="ExecuteSql"> <![CDATA[ if not exists(select * from cmsMacroPropertyType where macroPropertyTypeAlias = 'pluginValueTypePicker') begin insert into cmsMacroPropertyType ( macroPropertyTypeAlias, macroPropertyTypeRenderAssembly, macroPropertyTypeRenderType, macroPropertyTypeBaseType ) values ( 'pluginValueTypePicker', 'NWS.FacebookSocialPlugins', 'Macro.PluginValueTypePicker', 'String') end ]]></Action>
An error i the log says:
Error creating macro property: System.ArgumentException: No macro property type found with the id specified at umbraco.cms.businesslogic.macro.MacroPropertyType.setup() at umbraco.cms.businesslogic.macro.MacroPropertyType..ctor(String Alias) at umbraco.cms.businesslogic.macro.Macro.Import(XmlNode n)
The other "standard" macro properties installs fine.
Any help on this I could get would be greit, also how should I handle:
1. MySql Datasource?
2. Uninstall don't seem to work on the DB
There is a typo in either the property or your SQL script, the property says puginValueTypePicker and the script has the (presumably correct) spelling with the "l" in it (pluginValueTypePicker).
Thanx for pointing on the spelling mistake (does this make me feel stupid).
I have now corrected this, but it still do not work (at least not on a first install).
What happens if I look in the log is the following:- First a get an error creating the property (like in my first post)- Then the actions run correct.
If I uninstall the package and then install again it works fine (or if a manually insert into the DB first).For me this indicates that the error I get is correct, cause the insert in the DB happens after the Macro is created.
Can anyone confirm how the order in a package.xml works, and if you are able to tell the code something like "pre" and "post" actions.
I have been looking into the Package Actions Contrib and made a little "AddMacroProperty" action that works both with install and uninstall, I will test it a bit more and then send it for review.
Hehe, been there, done that. At some point you just start overlooking things if you're in too deep. That's when an extra pair of eyes really helps.
I am not of the order in which the package actions will be executed, but it sounds like it works on a clean install right? After you uninstall it works. But maybe during uninstall, the pluginValueTypePicker is not removed from the cmsMacroPropertyType table, so check that out first, but it sounds like you're good to go, right?
It is actaully the other way round it do NOT work on a clean install, because of the order it seems to be executing.
If I uninstall (makeing sure the pluginValueTypePicker is in the cmsMacroPropertyType table, with a undo=false) or do a manuall insert into the table It works because then the ID exist.
The workaround here is to:
1. Install the Package (with undo=false) - fails creating the propertys, but success with inserting into the table2. Uninistall the Package - do not delete from table3. Install the Package - now it works because the right things exists in table.
1. Do a manuall insert into the table
2. Install the Package - now it works because the right things exists in table.
None of these solutions is good enoght when I want to let people easy install my package, there must be tons of packages out there with Custom Macro Properties working, how?
I wouldn't be so sure of that! ;-)
In blog4umbraco, I know that some database stuff is being done after the install, you could have a look at the blog posts about that and the source code.
Aha, you mean a usercontrol based
Yes, that is right - they do DB stuff after install, I want to do it befor :-)
But i could try it this way and do my DB stuff in an ascx and then registrating the maco efter that, it should work.
But I realy would like to use the easy Package Actions.
I have now solved this making a second package action running after the AddMacroProperty action, findnig and updateing rows in DB.Thanks Sebastiaan for sharing your thoughts.
Still i am intressting in how other people solved this issue?
No problem, I've invited people to have a look at this, hopefully someone can provide an alternative!
I belive package actions are the last thing to run when installing a package, so that'll be why it's failing, because at the time of installing the Macro, the package action to install the property type hasn't yet run.
If you solution works, I'd probably just go with it (I have a fair few quirky workarounds in some of my packages).
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted