Coder Social home page Coder Social logo

razor-mediator-4-tridion's People

Contributors

alex-klock avatar chrismrgn avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

razor-mediator-4-tridion's Issues

Unable to save existing (v1.2) tbb's with version 1.3

What steps will reproduce the problem?
1. Upgrade to razor mediator 1.3 from 1.2
2. Make a change in existing tbb
3. Save the tbb, error will occur, most likely about some functions not in the 
scope of the tbb.

We import some of our (helper) tbb's in the Tridion config like:
<add 
import="/webdav/20%20Developer%20-%20Templates/Building%20Blocks/System/Libs/Raz
or/Helpers/RTBB_Constants.cshtml" />
<add 
import="/webdav/20%20Developer%20-%20Templates/Building%20Blocks/System/Libs/Raz
or/Helpers/RTBB_Helpers.cshtml" />

Running the code (publishing) works fine after the upgrade, but as soon as you 
want to change the tbb code and save it gives an error about functions not 
being in scope.

Removing the following line from the config that is set by the install of 1.3, 
solves this problem:
<importSettings includeConfigWhereUsed="true" includeImportWhereUsed="true" 
replaceRelativePaths="false" />

However I assume this is needed for the new 1.3 features like (from changelog):
Added Where Used functionality for imported TBBs.
Added configurative settings to control Where Used functionality, and ability 
to replace relative paths with full paths if desired.

Apart from the question if this new feature is handy for me, is this an actual 
bug? It only seems to give the error if you import the tbb's in the config.

Original issue reported on code.google.com by [email protected] on 30 Oct 2012 at 2:41

Not able to import razor template even after placing import settings

We have placed the below in Tridion.config file :
<razor.mediator cacheTime="60" extractBinaries="true" 
adminUser="ADS\svc.icmsyse1">
    <namespaces>
      <!-- <add namespace="System.Linq" />-->
      <!-- <add namespace="Test.Sample" />-->
    </namespaces>
    <assemblies>
      <!-- <add assembly="C:\Program Files\Assembly\Test.Sample.dll" /> -->
      <!-- <add assembly="RazorSample.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60ad7434f03dfcdc" /> -->
    </assemblies>
    <imports>
      <!-- <add import="tcm:120-2233-2048" />-->
      <!-- <add import="/wevdav/020 Design/Building Blocks/System/TBBs/Helpers/razor-helpers.cshtml" />-->
      <!-- <add import="C:\Program Files\Razor Mediator\razor-helpers.txt" />-->
      <!-- <add import="tcm:120-2200-2048" publications="020 Design Master,030 Another Web Design" />-->
    </imports>
    <importSettings includeConfigWhereUsed="true" includeImportWhereUsed="true" replaceRelativePaths="false" />


What steps will reproduce the problem?
1. We are using @importRazor(path) , here the path we are using is webdav path 
of another razor template building block
2. Then the TBB used in import statement is not imported
3.

What is the expected output? What do you see instead?
TBB used in importRazor function should be imported

What version of the product are you using? On what operating system?
We are using SDL Tridion 2011 and WINDOWS 64 bit


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 20 Mar 2013 at 5:54

Unable to Content Port Razor Code Using Content Porter SP1

What steps will reproduce the problem?
1. Export Razor code from one Tridion 2011 CM with Content Porter SP1
2. Import Razor code to another Tridion 2011 CM with Content Porter SP1


What is the expected output? What do you see instead?
Successful import of the razor building blocks.  Instead we get an error 
indicating the code cannot be imported.

What version of the product are you using? On what operating system?
Content Porter SP1


Please provide any additional information below.

See attached content port log

Original issue reported on code.google.com by [email protected] on 6 Jan 2013 at 12:50

Attachments:

Memory leak: AppDomain assembly resolve handler not unhooked causing template objects to leak.

The TridionRazorTemplate class initializer contains the following code: 

AppDomain.CurrentDomain.AssemblyResolve += new 
ResolveEventHandler(TemplateAssemblyResolveEventHandler);

This results in every instance of the object being referenced by the AppDomain. 
A new instance is created for every template invocation. 
Although the reference to the object goes out of scope, it remains "reachable" 
from the AssemblyResolve event's delegate list. This means that the 
TridionRazorTemplate can not be garbage collected, and neither can the 
TemplateRenderer and Session that it in turn references. 

Original issue reported on code.google.com by [email protected] on 1 Jun 2013 at 5:51

Smart quotes in code samples in document will not compile

What steps will reproduce the problem?
1. Paste code from the documentation into your TBB. e.g. 
    @foreach (var cp in GetComponentPresentationsByTemplate(“Test Template”)) {
        <div>Another component for template @cp.Template.Title:</div>
        <div>@cp.RenderComponentPresentation()</div>
    }

2. Note that "Test Template" is written as “Test Template”
3. Try to save the TBB. You will get a compiler error.

"Smart quote" characters like this are illegal as string delimiters in C#. 
Being able to copy/paste from the samples would be helpful to people trying to 
learn. 

Original issue reported on code.google.com by [email protected] on 30 Oct 2012 at 1:41

Memory leak Issues with Razor Mediator 1.3.3

Hi there,
We started using Razor Mediator 1.3.3 for our template designs. We notice there 
is memory leak during the publishing. We have written some reusable custom 
function razor and using in our razor design. Other than that it is simple 
razor code for creating the design. 

this is the razor setting on the tridion configuration

<razor.mediator extractBinaries="true" adminUser="INSERT TRIDION USERNAME">
    <namespaces/>
    <assemblies/>
    <imports>
      <add import="C:\Program Files (x86)\Tridion\Razor Mediator\helper.cshtml" />
    </imports>
    <importSettings includeConfigWhereUsed="false" includeImportWhereUsed="true" replaceRelativePaths="false" />
  </razor.mediator>

Please help in troubleshooting the issues. Is there anything we are missing.

Original issue reported on code.google.com by [email protected] on 30 Aug 2014 at 2:49

Models.GetCategory does not exist

While there is a Model.GetKeyword, there is no such thing to get a category. I 
am trying to loop in my razor template over every keyword in one specific 
category.

The only way I can do this at the moment is like this:
@foreach (dynamic rawKeyword in 
((Category)TridionHelper.Engine.GetObject(TridionHelper.Engine.LocalizeUri(new 
TcmUri(Package.category_id)))).GetKeywords()) {
                var keyword = Models.GetKeyword(rawKeyword.Id);
}

It would be nice to have a CategoryModel, and that you could get the localised 
keywords for the category the page is getting published to.

Original issue reported on code.google.com by [email protected] on 21 Jan 2014 at 4:31

Memory leak: Templates are removed from cache, therefore recompiled. Original assembly can't be unloaded

When publishing over a period of time, the memory consumed by the publisher 
process is seen to increase, and is not reclaimed. 

Cause: Razor templates are compiled to assemblies, which are loaded into the 
default app domain. Once loaded into an app domain an assembly remains there 
for the lifetime of the app domain. The caching strategy of the razor mediator 
is such that on exceeding a configured cache timeout, a template is removed, 
which means that on its next invocation a new assembly will be compiled and 
loaded. 




Original issue reported on code.google.com by [email protected] on 25 May 2013 at 5:49

IsLast on a component presentations list doesn't work as expected

Hi,

I think I've found a problem with the way IsLast works on component 
presentations lists in version 1.2.

If you use the following code:

@foreach (var cp in GetComponentPresentationsByTemplate("General Article"))
{
    <div>@cp.IsFirst @cp.IsLast</div>
}

We should expect to see something along the lines of (dependent on the CPs on 
the page:

<div>True False</div>
<div>False False</div>
<div>False False</div>
<div>False True</div>

What we really see is (again, dependent on the CPs on the page):

<div>True False</div>
<div>False False</div>
<div>False False</div>
<div>False False</div>

After looking at the code (TridionRazorTemplate.cs) for 
GetComponentPresetationsBy*() we are setting IsLast within the loop and 
relative to the component presentations on the page rather than the current 
index in the returned list:

cpm.IsLast = cpm.Index == ComponentPresentations.Count - 1;

Not 100% and not tested anything but a fix may be to set the IsLast property 
once the loop is finished using the last item in the returned list rather than 
for each loop item.  Would removing the above line in the loop and using 
something like the following after the loop work?

componentPresentations.Last().IsLast = true;

Not a major problem as we can just use a variable for the counter but figured 
you may want to know either way.

Cheers,
Andy W

Original issue reported on code.google.com by [email protected] on 14 May 2012 at 2:56

Razor template is not working in SiteEdit

What steps will reproduce the problem?
1. While opening the page in SiteEdit , razor template is not generating any 
site edit tags compared to RenderComponentField()function does
2.
3.

What is the expected output? What do you see instead?
Site Edit should be edited, but we are not able to do that due to site edit 
tags are not inserted by the functions in Razor

What version of the product are you using? On what operating system?
SDL Tridion 2011 and WINDOWS 64 bit

Please provide any additional information below.



Original issue reported on code.google.com by [email protected] on 20 Mar 2013 at 5:57

Null reference exception when creating new razor tbb

What steps will reproduce the problem?
1. Create a new TBB.
2. Select RazorTemplate as the template type
3. Save

When you save, you get a null reference exception. Here's a stack trace. 

StackTrace Information Details:
   at Tridion.Extensions.Mediators.Razor.Templating.RazorTemplateGenerator.ClearWhereUsed(TemplateBuildingBlock template) in c:\code\razorm\razor-mediator-4-tridion-read-only\Tridion.Extensions.Mediators.RazorMediator\Tridion.Extensions.Mediators.RazorMediator\Engine\RazorTemplateGenerator.cs:line 53
   at Tridion.Extensions.Mediators.Razor.RazorHandler.Compile(DateTime revisionDate) in c:\code\razorm\razor-mediator-4-tridion-read-only\Tridion.Extensions.Mediators.RazorMediator\Tridion.Extensions.Mediators.RazorMediator\RazorHandler.cs:line 197
   at Tridion.Extensions.Mediators.Razor.RazorHandler.CompileOnly(DateTime revisionDate) in c:\code\razorm\razor-mediator-4-tridion-read-only\Tridion.Extensions.Mediators.RazorMediator\Tridion.Extensions.Mediators.RazorMediator\RazorHandler.cs:line 173
   at Tridion.Extensions.Mediators.Razor.RazorContentHandler.ValidateCompilation() in c:\code\razorm\razor-mediator-4-tridion-read-only\Tridion.Extensions.Mediators.RazorMediator\Tridion.Extensions.Mediators.RazorMediator\RazorContentHandler.cs:line 137
   at Tridion.Extensions.Mediators.Razor.RazorContentHandler.PerformValidateContent() in c:\code\razorm\razor-mediator-4-tridion-read-only\Tridion.Extensions.Mediators.RazorMediator\Tridion.Extensions.Mediators.RazorMediator\RazorContentHandler.cs:line 127
   at Tridion.ContentManager.Templating.AbstractTemplateContentHandler.ValidateContent()

This points to the ClearWhereUsed function 
https://code.google.com/p/razor-mediator-4-tridion/source/browse/trunk/Tridion.E
xtensions.Mediators.RazorMediator/Tridion.Extensions.Mediators.RazorMediator/Eng
ine/RazorTemplateGenerator.cs#53

Workaround: Save the TBB as a different template type. Open it up again and 
change the template type to RazorTemplate

It seems likely we're trying to read the where-used of an item that doesn't 
exist yet. (It's also possible that this is only reproducible if you have the 
where-used feature configured. I haven't tested that.)

Would a simple null-reference check fix this? 

Original issue reported on code.google.com by [email protected] on 12 Nov 2013 at 6:10

Saving templates fails if admin user not configured

What steps will reproduce the problem?
1. Do not configure an admin user
2. ... or configure one, but do not configure the process to run as an 
impersonation user
3. Attempt to save a razor TBB

Under these circumstances, the mediator attempts to create a session, which in 
turn requires impersonating the admin user. 
(https://code.google.com/p/razor-mediator-4-tridion/source/browse/trunk/Tridion.
Extensions.Mediators.RazorMediator/Tridion.Extensions.Mediators.RazorMediator/Ra
zorHandler.cs#95)


Original issue reported on code.google.com by [email protected] on 2 Feb 2014 at 6:40

unable to get template type with id:8 while publishing

What steps will reproduce the problem?
1. When I Publish with Razor Template Publishing failed with the below message
2. "unable to get template type with id:8 while publishing "
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
Razor Mediator V.1.2 and SDL Tridion 2011 SP1

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 30 Oct 2014 at 7:11

Globally imported TBBs have a dependency on themselves created if includeConfigWhereUsed is true

What steps will reproduce the problem?
1. add a TBB in the imports section of Tridion.ContentManager.config and ensure 
that the includeConfigWhereUsed setting is true
2. Edit this TBB and save
3. Select Where used on the TBB and observe that a circular dependency has been 
created

This in itself is not too bad (you will never be able to delete the TBB 
however), the main problem comes with Content Porter - version 2013 SP1 (I 
havent tested earlier versions) will skip this TBB when importing (probably it 
detects the circular dependency)

If you set includeConfigWhereUsed to false and resave and export the TBB it 
will import fine. However if you do this you lose the rather useful dependency 
between imported TBB and importing TBB. It would be better if the Mediator did 
not create such a circular dependency in the first place.


Original issue reported on code.google.com by [email protected] on 16 Jan 2014 at 12:50

Patch for /trunk/Tridion.Extensions.Mediators.RazorMediator/Tridion.Extensions.Mediators.RazorMediator/Models/DynamicPackage.cs

Modified TryGetMember so that it doesn't cache the values provided by the 
Tridion package. Modified AddPackageItem and renamed it to 
GetDynamicItemFromTridionPackageItem in support of the same goal. 

Caching these values is not helpful, because the value returned by the Tridion 
package can change within the lifetime of the cache. (You could consider 
surfacing .Remove() in the DynamicPackage, and using that to dirty the cache, 
although that would still leave possible problems with people accessing the 
package directly.) 

This patch works for me, but I'd suggest a further review rather than just 
following my approach. Ping me if I can help. 

Original issue reported on code.google.com by [email protected] on 3 Dec 2012 at 3:56

Attachments:

Imported Razor TBB's not up-to-date

What steps will reproduce the problem?
1. Create a Razor Template that's imported from the contentManager.config
2. Have that template @importRazor another template
3. Render some stuff using the @importRazor imported template.
4. Change the @importRazor imported template.
5. Render some stuff using the @importRazor imported template again.
6. See that the changes haven taken into account when rendering

What is the expected output? What do you see instead?
The changes should immediately be visible in the output.

What version of the product are you using? On what operating system?
2013 SP1, latest Razor mediator

Original issue reported on code.google.com by [email protected] on 25 Mar 2014 at 8:57

Razor config imports with publications attribute does not work and break all razor templates

What steps will reproduce the problem?
1. Add tbb with razor helpers to imports section of 
Tridion.ContentManager.config
2. Make sure that you add publications attribute 
<add import="tcm:80-34567-2048" publications="020 Global MySite Design" />
3. Enable includeConfigWhereUsed in importSettings section
<importSettings includeConfigWhereUsed="true" ...
4. Open any Razor Template in any publication

What is the expected output? What do you see instead?
Expected output is to see Razor Template item and source code without any 
errors and be able to use my helpers.
I see error: Invalid OLEVERB structure (screenshot attached)
In Tridion Event Viewer I found many instances of this error:
RazorContentHandler: Error in ExtractReferences: Timeout expired.  The timeout 
period elapsed prior to obtaining a connection from the pool.  This may have 
occurred because all pooled connections were in use and max pool size was 
reached.


What version of the product are you using? On what operating system?
Product version 1.3.3.1
SDL Tridion SP1 HR1


Please provide any additional information below.
It is impossible to open any Razor Mediator template after such configuration.


Original issue reported on code.google.com by [email protected] on 21 Jan 2014 at 1:38

Attachments:

Razor helper file is not working from the WebDAV URL

Hi, 

I want to create some common function in Razor-Mediator templating which can be 
used in any other TBB,

As per the Razor doc, we can define these function in the helper file and need 
to map that file/TBB with the tridion with below setting 


    <razor.mediator cacheTime=”600” extractBinaries=”true” adminUser=”DOMAIN\Username”>
            <namespaces>
                <add namespace=”System.Linq” />
                <add namespace=”Tridion.ContentManagement” />
            </namespaces>
            <assemblies>
                <add assembly=”RazorSample.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60ad7434f03dfcdc” />
                <add assembly=”C:\Program Files\Razor\Tests\Test.Sample.dll” />
            </assemblies>
            <imports>
                <add import=\"tcm:120-2233-2048\" />
                <add import=\"/webdav/020 Design/Building Blocks/System/TBBs/Helpers/razor-helpers.cshtml\" />
                <add import=\"C:\\Program Files\\Razor Mediator\\razor-helpers.txt\" />
                <add import=\"tcm:120-2200-2048\" publications=\"020 Design Master,030 Another Web Design\" />
            </imports>
            <importSettings includeConfigWhereUsed="true" includeImportWhereUsed="true" replaceRelativePaths="false" />
        </razor.mediator>


I am able to import successfully my all function when I defined the physical 
path in the config file.  

But, its not working when I defined the wevDAV URL in the config file, 

Could any one please help or let me know if i am missing any steps?

Thanks 

Priyank 

Original issue reported on code.google.com by [email protected] on 22 Oct 2012 at 11:49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.