Add getter for file
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #2954413. --> Reported by: [quietone](https://www.drupal.org/user/2572884) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>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. </p> <p>See <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/migrate_tools/issues/2942373" title="Status: Closed (fixed)">#2942373: Add UI to alter column_names for CSV source files</a></span></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add a getter for $file</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Patch<br> review</p> > Related issue: [Issue #2942373](https://www.drupal.org/node/2942373)
issue