- 🇨🇦Canada joelpittet Vancouver
Sorry this has been a while, is this still a problem? The patch doesn't currently apply but I am wondering if others are running into this bug?
When calendar items are being rendered, the calendar only hides the first field type. This isn't an issue if there is only one instance of a field type.
When there are multiple instances of a field type, say a date fields where they are formatted differently and are hidden to be used in a conditional field, for example. Only the first date field will be hidden, and the second will be show even if it is marked to be hidden. Another example is if you have two image fields, and the first is set to be visible, and the second is set to be hidden, but the first will be hidden and the second will be shown.
The problem lies in how the template_preprocess_calendar_item function handles the render array. The core issue was that when going to unset a field, it was using the field's type not it's id. I changed the unset to use the field's id. In addition to this, I changed how the for loops where nested.
I have created a patch that fixes the issue by moving the rendered_fields for loop out of the views field loop. I then tested if a field was set to be hidden, and added that into an array. I then went through the render arrays looking for the fields that are suppose to be hidden. When a match is found that is suppose to be hidden, it is removed from the render array.
Postponed: needs info
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Sorry this has been a while, is this still a problem? The patch doesn't currently apply but I am wondering if others are running into this bug?