Comments (5)
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.
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.
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.
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.
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)
- [3.x]: add ownerId Filter to the query with 'not ID'. .ownderId("not 1") for example HOT 3
- [5.x]: Color Selection Improvement for disabled/enabled elements HOT 3
- [5.x]: Email fields aren't showing HOT 3
- craft root files are publicly visible and accessible [4.x]: HOT 4
- [5.x]: UX issue with Password Reset dialog. No way to close dialog box. HOT 2
- [4.x]: cookieValidationKey must be configured with a secret key. HOT 5
- [5.x]: Element chips and cards show other users' provisional drafts HOT 1
- [5.x]: Slideout shortcuts broken when the slideout is opened via disclosure menu HOT 3
- [4.9.7]: Calling unknown method: craft\web\Response::getIsDraft() HOT 2
- [5.x]: a11y issue with status indicators HOT 3
- [5.x]: Level indentation broken for entries with status label in structured sections HOT 1
- [5.x]: Replace File assets - UI doesn't provide enough feedback to authors HOT 2
- Serialization failure HOT 5
- [5.x]: Float numbers in GraphQL weird behaviour HOT 1
- [5.x]: When using editableTableField, with autosuggest and suggestEnvVars, the dropdown only appears on first table row
- [5.x]: SVGs are considered "Images" HOT 5
- [5.x]: 0 added to all empty fields HOT 4
- [5.x]: Upgrade from Craft 4 deletes all text fields HOT 4
- [5.x]: Error on the edit page for created assets by asset index utility from files with spaces in filename HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cms.