Giter Club home page Giter Club logo

Comments (6)

Shazwazza avatar Shazwazza commented on May 20, 2024

1.0.4 is a minor release and only contains bug fixes, should be a very straight forward upgrade but of course you should test before you launch. Worth a try to see if it fixes it, can't say for sure. I won't have time to look into this for a few weeks.

from articulate.

jaandrews avatar jaandrews commented on May 20, 2024

Thanks for the quick response. I tried upgrading, but that didn't resolve the issue. I'll just work around this issue with the old way of building macros for now.

from articulate.

Shazwazza avatar Shazwazza commented on May 20, 2024

The underlying problem is that for any virtual pages, the ID assigned to it is 'virtual', meaning that there is no corresponding real node in umbraco.

The error comes from this line in UmbracoHelper:

m.renderMacro(attributes, umbracoPage.Elements, this.UmbracoContext.PageId.Value);

As you can see it's using this.UmbracoContext.PageId.Value as the current page id. On a virtual page this will be based on a simple algorithm and int.Max value. So when the old macro object tries to look this up it gives an error since that id doesn't exist.

I think in order for this to work (even though i still think there might be issues), we'll have to modify the Umbraco core. Unfortunately the way macros render is based on code made a century ago so it's difficult to work with.

I'll log an issue on the umbraco tracker for this.

from articulate.

Shazwazza avatar Shazwazza commented on May 20, 2024

http://issues.umbraco.org/issue/U4-5943

from articulate.

Shazwazza avatar Shazwazza commented on May 20, 2024

Instead of using macros though, you can just use partial views directly... will be faster too. The only real reason to use macros nowadays is if you need support for your editors to insert macro parameters, which generally only pertains to the rich text editor or grid.

from articulate.

Shazwazza avatar Shazwazza commented on May 20, 2024

This is fixed in umbraco now in rev: umbraco/Umbraco-CMS@73e9ff0

from articulate.

Related Issues (20)

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.