Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Trying to build a calendar in Views by using referenced dates from nodes with mutiple value references to a paragraph type holding dates as a contextual filter is not showing any of the saved dates in the Views calendar.
Comment | File | Size | Author |
---|---|---|---|
#17 | paragraphp view.txt | 17.33 KB | chrotto |
#15 | CalendarView.png | 127.64 KB | chrotto |
#11 | calendar-remove_type_limitation--2644232-11.patch | 735 bytes | othermachines |
Comments
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous at XIO commentedAfaik, there has not been any effort towards integrating/testing that particular case. Was this working in the Drupal 7 version of the module?
Comment #3
breadcrumbs CreditAttribution: breadcrumbs commentedYes, I just did a quick test with d7 and it's working.
In d8 I can create a view starting from a template (A calendar view of the 'Datum' field in the 'Paragraph' base table) but nothing shows
Any chance you could have a look?
Comment #4
breadcrumbs CreditAttribution: breadcrumbs commentedI think the error lies in the viewsFetchFields function in CalenderHelper.php
Fields are not added because they are limited to nodes
If I disable the check on line 680 then it works
So the check --> if ($base == substr($key, 0, 4)) <-- should be made dynamic and not limited to nodes only
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous at XIO commented#4 was my initial thought, but let's take a step back here. I'm not able to select the right fields to create a calendar based on a paragraph with a date field. Can you export your views configuration or take a screenshot, so I'm sure I am trying to reproduce the right thing.
Comment #6
breadcrumbs CreditAttribution: breadcrumbs commentedHere's a screenshot of the view. It's best to start from the view template (A calendar view of the 'Datum' field in the 'Paragraph' base table), it's the only way to get it working.
Relationship you see is not needed, that's because I want the title from the node that is referencing the paragraph entity. This is also something that isn't working yet, but not sure if this is a paragraphs, views or calendar bug. Works in d7 by just adding the relationship.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous at XIO commentedHmm. I'm still not able to reproduce your situation since I keep hitting issues with paragraphs/views/views templates. It's probably somewhat the same as the ones you have for the relationship (which you need for the contextual filter anyway).
Fwiw, I'm on the latest dev version for everything.
Comment #8
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedLooks like I am having this issue as described in #2699477-39: Steps towards handling end dates in Calendar 8.
Comment #9
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedHere is an export of my view:
Comment #10
scotthorn CreditAttribution: scotthorn at Achieve Internet commented#4 is indeed part of the problem, it will filter to only fields on the base table no matter if the substr part is fixed to be the length of $base.
There's also an issue in src/Plugin/views/row/Calendar.php around line 440. The code currently does $entity->get($field_name) without checking if the field exists, which throws a 500 error if it's from a relationship. I was able to get it to mostly work by changing it to this:
I'm still getting a few noticed, but the calendar seems to be working with the correct rows returned. I removed the check from #4, which isn't ideal, probably need to know which bases to test against.
Comment #11
othermachines CreditAttribution: othermachines commentedI put the fix suggested in #4 into a patch. It removes the substring check altogether as suggested by @breadcrumbs (thx!). Checking if what is appended to
$key
matches$base
is sufficient if your base table is, say, 'paragraph' (like mine is), but obviously that doesn't solve the problem of having a relationship with a different type.Edit: No longer using this:
This no doubt needs more investigation but for now this (along with patch in #2859127-2: Undefined property the query name on row) gets things working for me.Comment #12
chrotto CreditAttribution: chrotto commentedI just installed Paragraph module and hoped to use a paragraph field referencing to a type with a date field.This is still not working (using Drupal 8.4.2).
Is it any solution in sight? Or is this perhaps an issue for paragrath module?
Comment #13
othermachines CreditAttribution: othermachines commented@chrotto:
I'm using a Paragraphs relationship with a patched-up version of Calendar in 8.3 (includes patch in #11). What does your view config look like?
Comment #14
chrotto CreditAttribution: chrotto commentedI am using the latest version of Drupal (8.4.2), Paragraph (8.x.1.2) and calendar (8.x-1.x-dev).
My view configuration:
uuid: 733fd314-39cf-4b7a-9b39-2afa166af618
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_beskrivning
- field.storage.node.field_projektnamn
- field.storage.paragraph.field_deadline
module:
- calendar
- datetime
- node
- paragraphs
- user
id: deadlines_via_paragraph
label: 'Deadlines via Paragraph'
module: views
description: 'A calendar view of the ''Deadline'' field in the ''Paragraph'' base table'
tag: ''
base_table: paragraphs_item_field_data
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: calendar
options:
pager_placement: top
style:
type: calendar
options:
calendar_type: month
mini: '0'
name_size: '3'
with_weekno: '0'
max_items: '0'
max_items_behavior: more
groupby_times: hour
groupby_times_custom: null
theme_style: '1'
groupby_field: ''
multiday_theme: '1'
multiday_hidden: { }
row:
type: calendar_row
options:
colors:
legend: type
calendar_colors_type:
projekt: '#ffffff'
article: '#ffffff'
helgdag: '#ffffff'
page: '#ffffff'
projektrapport: '#ffffff'
fields:
field_deadline:
id: field_deadline
table: paragraph__field_deadline
field: field_deadline
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: datetime_default
settings:
timezone_override: Europe/Stockholm
format_type: medium
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
field_beskrivning:
id: field_beskrivning
table: node__field_beskrivning
field: field_beskrivning
relationship: reverse__node__field_deadlines
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: basic_string
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
field_projektnamn:
id: field_projektnamn
table: node__field_projektnamn
field: field_projektnamn
relationship: reverse__node__field_deadlines
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
filters:
status:
value: '1'
table: paragraphs_item_field_data
field: status
plugin_id: boolean
entity_type: paragraph
entity_field: status
id: status
expose:
operator: ''
group: 1
sorts:
field_deadline_value:
id: field_deadline_value
table: paragraph__field_deadline
field: field_deadline_value
relationship: none
group_type: group
admin_label: ''
order: ASC
exposed: false
expose:
label: ''
granularity: second
plugin_id: datetime
header: { }
footer: { }
empty: { }
relationships:
reverse__node__field_deadlines:
id: reverse__node__field_deadlines
table: paragraphs_item_field_data
field: reverse__node__field_deadlines
relationship: none
group_type: group
admin_label: field_deadlines
required: true
entity_type: paragraph
plugin_id: entity_reverse
arguments: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- user.permissions
tags:
- 'config:field.storage.node.field_beskrivning'
- 'config:field.storage.node.field_projektnamn'
- 'config:field.storage.paragraph.field_deadline'
page_day:
display_plugin: page
id: page_day
display_title: Day
position: 3
display_options:
display_extenders: { }
display_description: ''
style:
type: calendar
options:
calendar_type: day
mini: '0'
name_size: '3'
with_weekno: '0'
max_items: '0'
max_items_behavior: more
groupby_times: hour
groupby_times_custom: null
theme_style: '1'
groupby_field: ''
multiday_theme: '1'
multiday_hidden: { }
defaults:
style: false
row: false
arguments: false
header: false
row:
type: calendar_row
options:
colors:
legend: type
calendar_colors_type:
article: '#ffffff'
page: '#ffffff'
taxonomy_field: ''
calendar_colors_vocabulary: { }
path: calendar-paragraph-field_deadline/day
menu:
type: tab
title: Day
description: ''
expanded: false
parent: ''
weight: 0
context: '0'
menu_name: main
arguments:
field_deadline_value_full_date:
id: field_deadline_value_full_date
table: paragraph__field_deadline
field: field_deadline_value_full_date
relationship: none
group_type: group
admin_label: ''
default_action: default
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: date
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: true
validate:
type: calendar
fail: 'not found'
validate_options:
replacement_format: 'l, F j, Y'
plugin_id: datetime_full_date
header:
calendar_header:
id: calendar_header
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: 1
content: '{{ arguments.field_deadline_value_full_date }}'
pager_embed: 0
plugin_id: calendar_header
calendar_header_1:
id: calendar_header_1
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: 'Calendar Pager'
empty: true
tokenize: 1
content: ''
pager_embed: 1
plugin_id: calendar_header
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user.permissions
tags:
- 'config:field.storage.node.field_beskrivning'
- 'config:field.storage.node.field_projektnamn'
- 'config:field.storage.paragraph.field_deadline'
page_month:
display_plugin: page
id: page_month
display_title: Month
position: 1
display_options:
display_extenders: { }
path: calendar-paragraph-field_deadline/month
display_description: ''
menu:
type: tab
title: Month
description: ''
expanded: false
parent: ''
weight: 0
context: '0'
menu_name: main
tab_options:
type: normal
title: Calendar
description: ''
weight: 0
arguments:
field_deadline_value_year_month:
id: field_deadline_value_year_month
table: paragraph__field_deadline
field: field_deadline_value_year_month
relationship: none
group_type: group
admin_label: ''
default_action: default
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: date
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: true
validate:
type: calendar
fail: 'not found'
validate_options:
replacement_format: 'F Y'
plugin_id: datetime_year_month
header:
calendar_header:
id: calendar_header
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: 1
content: '{{ arguments.field_deadline_value_year_month }}'
pager_embed: 0
plugin_id: calendar_header
calendar_header_1:
id: calendar_header_1
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: 'Calendar Pager'
empty: true
tokenize: 1
content: ''
pager_embed: 1
plugin_id: calendar_header
defaults:
arguments: false
header: false
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user.permissions
tags:
- 'config:field.storage.node.field_beskrivning'
- 'config:field.storage.node.field_projektnamn'
- 'config:field.storage.paragraph.field_deadline'
page_week:
display_plugin: page
id: page_week
display_title: Week
position: 2
display_options:
display_extenders: { }
display_description: ''
style:
type: calendar
options:
calendar_type: week
mini: '0'
name_size: '3'
with_weekno: '0'
max_items: '0'
max_items_behavior: more
groupby_times: hour
groupby_times_custom: null
theme_style: '1'
groupby_field: ''
multiday_theme: '1'
multiday_hidden: { }
defaults:
style: false
row: false
arguments: false
header: false
row:
type: calendar_row
options:
colors:
legend: type
calendar_colors_type:
article: '#ffffff'
page: '#ffffff'
taxonomy_field: ''
calendar_colors_vocabulary: { }
path: calendar-paragraph-field_deadline/week
menu:
type: tab
title: Week
description: ''
expanded: false
parent: ''
weight: 0
context: '0'
menu_name: main
arguments:
field_deadline_value_year_week:
id: field_deadline_value_year_week
table: paragraph__field_deadline
field: field_deadline_value_year_week
relationship: none
group_type: group
admin_label: ''
default_action: default
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: date
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: true
validate:
type: calendar
fail: 'not found'
validate_options:
replacement_format: 'F j, Y'
plugin_id: datetime_year_week
header:
calendar_header:
id: calendar_header
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: 1
content: 'Week of {{ arguments.field_deadline_value_year_week }}'
pager_embed: 0
plugin_id: calendar_header
calendar_header_1:
id: calendar_header_1
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: 'Calendar Pager'
empty: true
tokenize: 1
content: ''
pager_embed: 1
plugin_id: calendar_header
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user.permissions
tags:
- 'config:field.storage.node.field_beskrivning'
- 'config:field.storage.node.field_projektnamn'
- 'config:field.storage.paragraph.field_deadline'
page_year:
display_plugin: page
id: page_year
display_title: Year
position: 4
display_options:
display_extenders: { }
display_description: ''
style:
type: calendar
options:
calendar_type: year
mini: '0'
name_size: '3'
with_weekno: '0'
max_items: '0'
max_items_behavior: more
groupby_times: hour
groupby_times_custom: null
theme_style: '1'
groupby_field: ''
multiday_theme: '1'
multiday_hidden: { }
defaults:
style: false
row: false
arguments: false
header: false
row:
type: calendar_row
options:
colors:
legend: type
calendar_colors_type:
article: '#ffffff'
page: '#ffffff'
taxonomy_field: ''
calendar_colors_vocabulary: { }
arguments:
field_deadline_value_year:
id: field_deadline_value_year
table: paragraph__field_deadline
field: field_deadline_value_year
relationship: none
group_type: group
admin_label: ''
default_action: default
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: date
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: true
validate:
type: calendar
fail: 'not found'
validate_options:
replacement_format: 'Y'
plugin_id: datetime_year
header:
calendar_header:
id: calendar_header
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: 1
content: '{{ arguments.field_deadline_value_year }}'
pager_embed: 0
plugin_id: calendar_header
calendar_header_1:
id: calendar_header_1
table: views
field: calendar_header
relationship: none
group_type: group
admin_label: 'Calendar Pager'
empty: true
tokenize: 1
content: ''
pager_embed: 1
plugin_id: calendar_header
path: calendar-paragraph-field_deadline/year
menu:
type: tab
title: Year
description: ''
expanded: false
parent: ''
weight: 0
context: '0'
menu_name: main
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user.permissions
tags:
- 'config:field.storage.node.field_beskrivning'
- 'config:field.storage.node.field_projektnamn'
- 'config:field.storage.paragraph.field_deadline'
Comment #15
chrotto CreditAttribution: chrotto commented@othermachines
I am using Drupal 8.4.2 and I think my Calendar version have the patch in #11.
My view UI looks like this:
Comment #16
othermachines CreditAttribution: othermachines commented@chrotto - Sorry for the delay, it's a busy time.
It looks like you might not be pointing to your relationship (reverse__node__field_deadlines) in your contextual filter, nor the sort criteria, although it's hard to be sure. Unfortunately it's hard to make sense of your configuration since all formatting was lost when you pasted it into your comment (better to just attach the yml file). Anyway, I would check that first.
Comment #17
chrotto CreditAttribution: chrotto commentedThank´s for helping.
I attached the config-file.
When trying to add the #11 patch I am getting an error message:
Can't find file to patch at line 5
Comment #18
othermachines CreditAttribution: othermachines commentedLooking at your config file it appears you no longer have any relationships set up.
If my suggestions in #16 didn't help, I'd suggest moving your problem to the Drupal help forums.
The patch probably needs a re-roll since there have been a few commits since it was created. I'll have a look at that when I get some free time, hopefully in the next week or so.
Comment #19
chrotto CreditAttribution: chrotto commentedThe config is the one I get when saving the Paragraph template with date fields (deadline).
When changing this view to Table the fields is visible but not in the calendar view.
Comment #20
dqd@nicholas.alipaz and @chrotto: can you PLEASE post your endless configs somewhere else like pastebin or gist and link here to remove this endless clutter and scrolling. This issue is important and needs attention of main contributors.
@nicholas.alipaz: by the way cross linking to your asking for help in another issue is not very helpful here especially with long config spagetti. Your issue is related to where you linked to, not here. So please remove (shorten) your long posts.
... and yes (for those still asking):
It's a bug. - as stated already by @breadcrumbs - Even the views template example using date field of paragraph is not showing any date (tested here with Drupal 8.5.x with latest module devs) and we should consider temporary work arounds because even if the Calendar or Date fields cause issues, Paragraph module itself states on its project page that paragraph was not intended to work as a pathless entity bundle perfectly in ALL circumstances. So be careful by using paragraph as a 100% replacement for the field collections and multiple field values combination or for X rel data sets.
My suggestion for now: Create custom event or date content types and refer them to the other content types you need them on and use something like https://www.drupal.org/project/reverse_entity_reference or https://www.drupal.org/project/cer to make the reference accessable from both sides. Or use date fields with multitple value setting directly on the referring content type. That's it for now, sadly.
Comment #21
dqdComment #22
dqdComment #23
BlondeSwan CreditAttribution: BlondeSwan commentedAny update on this bug? It still exists, but I cannot apply the patch, it throws an error saying the patch can't be applied.
Comment #24
DuneBLI just started to use this module and my first use case was a date field inside a paragraph... and it works without any added patch