No way to modify/alter/preprocess fields/rows when using wizard plugins

Created on 31 January 2022, almost 3 years ago
Updated 21 August 2023, about 1 year ago

Problem/Motivation

The views_ical ical_fields_wizard, ical_wizard plugins ignore theming layer at all.

Steps to reproduce

Altering results using UI.
1. Create node-based view,
2. Add "iCal display" display,
3. Select "iCal Style Wizard" & "iCal fields row wizard",
4. Add Title field and tick "Override the output of this field with custom text" under "REWRITE RESULTS" fieldset and override with "{{ title }}, {{ nid }}".
5. Select "Title" as "SUMMARY field" in "iCal display: Style options" settings.

Expected result should be title + nid in "SUMMARY field". The actual result is just title.

Programmatic way:
1. Repeat 1-3 steps.
2. Implement either MY_MODULE_ preprocess_views_view_ical_fields(&$variables) or MY_THEME_ preprocess_views_view_ical_fields(&$variables) function.
3. Alter variables.

Expected result should be altered data, the actual result is ignored preprocess function.

Proposed resolution

I think we should follow plugin's architecture of the already existing views "data" solutions like: https://www.drupal.org/project/views_data_export β†’ and \Drupal\rest\Plugin\views\display\RestExport, \Drupal\rest\Plugin\views\row\DataFieldRow

Remaining tasks

Introduce at least method to get/set events.

User interface changes

N/A

API changes

TBD

Data model changes

Introduce at least \Drupal\views_ical\Plugin\views\style\IcalWizard::$events variable and getter/setter.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine vlad.dancer Kyiv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom very_random_man

    I think the problem here is that the row style is based on Fields instead of extending EntityRow which would include a view mode in the config and you could still do the exact same thing in the render except you'd also have the ability to use field formatting / theming. You could hook up the config form to available fields on the entity rather than the ones defined in the view.

  • πŸ‡ΊπŸ‡¦Ukraine Ruslan Piskarov Kiev, Ukraine

    Ruslan Piskarov β†’ made their first commit to this issue’s fork.

  • @ruslan-piskarov opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    MR still seems to render a view mode that is named "ical". For this, I'm just struggling how to reconcile rendering fields in the theme layer, and applying any views re-writes, and then feeding those values to the iCalendar object. This was actually possible in the legacy display handler, which did use a twig template, but the eluceo/ical package does a lot of the heavy lifting for us to properly generate an iCal feed here. This might require a deeper dive into re-architecting this module than I have time for at the moment unfortunately, but I am happy to review any patches or merge requests that anyone posts.

Production build 0.71.5 2024