Macro Documents.Where not working

Tom Troughton asked on November 11, 2015 16:18

Hi. I've picked up a project where a developer has used a macro in the template like this: Documents.Where("NodeGUID='f9067800-c8b9-46af-86ec-e35678ecc702'")[0].NodeAliasPath

This appears to be returning a valid alias path in the live environment, but on my dev environment this returns nothing. Indeed, even if I change it to Documents.Count the macro returns 0.

I know for sure there's a node with node GUID f9067800-c8b9-46af-86ec-e35678ecc702. Can anyone explain this behaviour?

Correct Answer

Joshua Adams answered on November 11, 2015 18:54

Have you tried to resign the macro signatures?

0 votesVote for this answer Unmark Correct answer

Recent Answers


David te Kloese answered on November 11, 2015 23:00

Hi,

When you say "used a macro in the template" do you mean on a setting of a webpart placed on a template? Or do directly in the layout of a template?

If signing macros (as Joshua suggested) doesn't help, you might want to look at macro debugging:

https://docs.kentico.com/display/K82/Debugging+macros

This might point you in the right direction of the error.

Greets,

David

0 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on November 12, 2015 12:09

Thanks guys. Yes, I had to resign the macros. Not the first time I've been caught out by that. Still don't understand what resigning macros actually means.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on November 12, 2015 14:06

Hi,
Each macro can have a security signature. Macros are powerful and you could reveal some sensitive information through a macro. So, with the signature you basically say what permissions should be applied to display that data. You can find more on this topic in this chapter

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.