Giter Site home page Giter Site logo

Comments (5)

i-just avatar i-just commented on June 22, 2024

Hi, thanks for getting in touch! I can’t seem to replicate this. Following your steps, I’m able to get the entry and then the content of the blockImage Assets field (where blockImage is the overwritten handle) on that entry.

Could you please share your twig code to get the entry and the content of the blockImage?

from cms.

lexisother avatar lexisother commented on June 22, 2024

It's a bit difficult to share my Twig code concisely, as it's using a custom matrix block template including system.
The general gist of it is as follows:

index.twig where entry.blocks is a matrix field with all my entry types:

{% include "_partials/blocks.twig" with { 'blocks': entry.blocks } %}

_partials/blocks.twig just loops over the blocks and includes _partials/blocks/{block.type}.twig with block passed into it.

Where I was encountering the issue was on a matrix block with a field of type Assets where the field handle was blockImage2, locally aliased to blockImage in that matrix field. I then tried using block.blockImage.one() to get my image, which is how I ran into the bug I described.
Only after renaming blockImage2 to imageTextImage and removing the alias for it did I get the expected result.

I understand the issue is super hazy and probably sounds like a one-off, but this was happening in more places than just my Assets block. I had to give all my matrix blocks unique handles and remove the aliases for them to fix it.

from cms.

i-just avatar i-just commented on June 22, 2024

Thanks for sharing more details on this!

Unfortunately, I’m unable to replicate this even after following your template setup.

blockImage2 suggests that maybe you had the same Assets field added to this particular field layout more than once. Would you happen to know if that was the case? It shouldn’t be possible as relational fields are not multi-instance, but a bug allowed this in the early beta version (fixed in 5.0.0-beta.2). Or maybe the field in question was of a different type initially?

It sounds like you have already changed your setup. Do you have a backup (project config or database) of the setup with this problem? If so, could you send it to [email protected] along with composer.json and composer.lock and point out the entry where you saw this happen so we can try to replicate and dig deeper?

from cms.

lexisother avatar lexisother commented on June 22, 2024

Now that I reverted my workspace to when I still had the issue, I seem to be unable to reproduce this strange bug... Super unfortunate, because I was hoping this wasn't just a strange one-off. Sorry for bothering!

from cms.

i-just avatar i-just commented on June 22, 2024

Thank you for checking, and I’m glad to hear it’s working as expected! Let us know if this happens again in a reproducible way.

from cms.

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.