blipson89 / Synthesis

Synthesis is a universal object mapper for Sitecore
MIT License
75 stars 25 forks source link

Models are generated at drive root regardless of sourceFolder value #64

Closed rroman81 closed 6 years ago

rroman81 commented 6 years ago

Do you want to request a feature or report a bug? I want to report a bug.

What is the current behavior? I have deployed the appropriate the configuration files that came Syntehsis 8.2.6. I have defined the z.DevSettings.config with the following:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <sitecore>
        <sc.variable name="sourceFolder" value="C:\tfs\sitecore\BHFoundation\DEV\src"/>
    </sitecore>
</configuration>

However, the models are generated under the systemdrive root instead.

If the current behavior is a bug, please provide the steps to reproduce.

I run the /synthesis.aspx where it reports that a few templates are not synchronized. Clicking Regenerate, succeeds and report success.

What is the expected behavior? I would expect the files to be generated under the sourceFolder root, or error shown.

Please mention your Sitecore version and Synthesis version.

I am using Sitecore 8.2 Update 3 with Synthesis 8.2.6.

blipson89 commented 6 years ago

Hi @rroman81,

Could you try adding this to your z.DevSettings.config file:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <settings>
            <setting name="Synthesis.ModelOutputBasePath">
                <patch:attribute name="value">$(sourceFolder)\</patch:attribute>
            </setting>
        </settings>
    </sitecore>
</configuration>
rroman81 commented 6 years ago

Yep. That was a good catch. Unsure how that setting got overwritten. Thank you.

Final patch code looks like this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <sitecore>
        <sc.variable name="sourceFolder" value="C:\tfs\sitecore\BHFoundation\DEV\src"/>

        <settings>
            <setting name="Synthesis.ModelOutputBasePath" value="$(sourceFolder)\" />
        </settings>
    </sitecore>
</configuration>
blipson89 commented 6 years ago

Nice! Glad I could help 😃