I couldn't find any issues that matched what I'm seeing here.
In the displays for the fullcalendar other than month (Week, Day, List):
If the "Use entity fields" option in the view settings if OFF (using views rendering rather than entity fields) AND the title field is linked
the title will show as an escaped plain text link.
I've attached some screenshots.
In the fullcalendar_view.theme.inc file on line ~243 the title uses the views advancedRender function.
If I change that to use getValue instead it renders ok on those other displays.
Original:
// Event title.
if (empty($options['title']) || $options['title'] == 'title') {
$title = $fields['title']->advancedRender($row);
}
elseif ($current_entity->hasField($options['title'])) {
$title = $fields[$options['title']]->advancedRender($row);
}
else {
$title = 'Invalid event title';
}
}
$entry = [
'title' => $title,
'description' => $des,
'id' => $entity_id,
'url' => $current_entity->toUrl()->toString(),
];
My change:
// Event title.
if (empty($options['title']) || $options['title'] == 'title') {
$title = $fields['title']->getValue($row);
}
elseif ($current_entity->hasField($options['title'])) {
$title = $fields[$options['title']]->advancedRender($row);
}
else {
$title = 'Invalid event title';
}
}
$entry = [
'title' => $title,
'description' => $des,
'id' => $entity_id,
'url' => $current_entity->toUrl()->toString(),
];
I'm not really sure why the Month display is ok and this affects only the Week, Day and List displays.
Comments
Comment #2
anschinsan commentedHi jimmynash,
I experienced kind of the same issue - but unfortunately your solution didn't work for me because I need the 'Rewrite Result' value of the views field.
The views->advancedRender outputs escaped html and adds some br tags with any configuration I could imagine. Strange enough - everything works fine in the month view, but the html in list view is escaped :(
As a solution without changing the module I found that I could overwrite template_preprocess_views_view_fullcalendar() function in my templates theme file.
In any case I wonder if the output could be the same for the month and the other views? This would make all the overwriting obsolete :) Sorry to say that I didn't find out, where this different texts are set.
Comment #3
dak5859 commentedI'm having the same issue because I've also unchecked the "Use entity fields" setting so I can use the event description/body field that would honor the use of the "Summary or trimmed" formatter. And this was only after I applied the patch in this issue - https://www.drupal.org/project/fullcalendar_view/issues/3054176. jimmynash - any chance you could submit your change as a patch?
Comment #4
dak5859 commentedSubmitting patch for review based on jimmynash's solution in issue description.
Comment #5
mingsongThanks for the patch.
Could anyone test it for us?
Comment #6
mrogers commentedPatch in #4 resolved the issue for me.
Comment #7
sunsetco commentedHmm...
I applied the patch in #4, but I am still getting the html code for the href...
Comment #8
blueblot commentedpatch #4 works fine.
Thx
Comment #9
snsblvd commentedpatch #4 works for me, too.
Comment #10
b_sharpe commentedI found this to be not a problem with the output, but rather the JS selector using span instead of div. I aslo with #2 needed to rewrite the output of the view field.
Here is a patch that worked for me and allows views to function per normal, but rather uses a different selector and the event title when changing calendar view modes.
Comment #11
providence_matt commentedThe patch in #10 worked for me on the week and day view of the calendar. It did not work on the "list" view of the calendar. I was also rewriting a view result field as described in #2.
I've added a minor adjustment to the patch in #10 to allow this to work on the list calendar view.
Comment #13
mingsongThank you all for the patches and testing.
I make a minor amendment based on patch #11 with security improvement.
Now, it is ported.
Comment #14
mingsongComment #16
mingsong