Problem/Motivation

Building the UI to edit the column aliases requires the file object as it is after setupFile(). That is a protect method but fortunately it is called from the public method initializeIterator(). So that can be used. Unfortunately, that is not the case. It does not work because CSV::initializeIterator() doesn't always return the file object. In the case when the source plugin uses yield it returns a Generator.

See #2942373: Add UI to alter column_names for CSV source files

Proposed resolution

Add a getter for $file

Remaining tasks

Patch
review

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
556 bytes

A patch.

heddn’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests, +Novice

Let's add a quick unit test and this is good to go. Tagging as novice, because something like this is a great opportunity for someone new to creating php unit tests.

edysmp’s picture

Assigned: Unassigned » edysmp

working on this,

edysmp’s picture

Assigned: edysmp » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
954 bytes
1.45 KB

Attaching a test.

Ada Hernandez’s picture

FileSize
1.45 KB
489 bytes

fixing some nits

  • heddn committed 4c94aaa on 8.x-2.x authored by edysmp
    Issue #2954413 by edysmp, quietone: Add getter for file
    
heddn’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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