Problem/Motivation

I upgraded to PHP 8, Drupal 9 and whatnot. Now my Excel exports bomb.

Steps to reproduce

I attached the view but the point is, if the style is configured in the default display and not the overridden data export display then the options are simply not there.

Proposed resolution

The patch attached works -- and after writing it I found line 802 and 807 uses the same code which gives me some confidence. Is it time for a helper method? ksenzee taught me to factor out things used three times :)

drush php has this to say:

>>> $view->getStyle()->options['formats'];
=> [
     "xlsx" => "xlsx",
   ]
>>> $view->getDisplay()->options['style']
=> [
     "type" => "data_export",
     "options" => [],
   ]

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Charlie ChX Negyesi created an issue. See original summary.

ghost of drupal past’s picture

Issue summary: View changes
ghost of drupal past’s picture

Title: Excel batch completely fails » Excel batch completely fails if style is given in default display
Issue summary: View changes

steven jones made their first commit to this issue’s fork.

steven jones’s picture

Thanks @ghost of drupal past!

I've applied your patch to a MR, and we'll merge that in if all existing tests pass.

  • steven jones committed 16d2013d on 8.x-1.x
    Issue #3281764 by ghost of drupal past, steven jones: Excel batch...
steven jones’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.