Problem/Motivation

Follow-up to #3223209: deprecate file_save_data, file_copy and file_move and replace with a service

There was too many changes with FileUploadHandler before 9.3.0 alpha release, so this change has been added as follow up.

\Drupal\file\Upload\FileUploadHandler::loadByUri() with \Drupal\file\FileRepositoryInterface::loadByUri()

Steps to reproduce

NA

Proposed resolution

TBD

Remaining tasks

NA

User interface changes

NA

API changes

Deprecate FileUploadHandler::loadByUri() and replace all usages inside the class with FileRepositoryInterface::loadByUri()

Data model changes

NA

Release notes snippet

NA

Issue fork drupal-3245249

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

kim.pepper created an issue. See original summary.

larowlan’s picture

Title: [PP-1] Replace FileUploadHandler::loadByUri() with FileRepositoryInterface::loadByUri() » Replace FileUploadHandler::loadByUri() with FileRepositoryInterface::loadByUri()

The blocker is in

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dimitriskr made their first commit to this issue’s fork.

dimitriskr’s picture

Status: Active » Needs review

I don't think we eventually need a CR, right? This method is protected

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work

See a few more instances of ->loadByUri in core. Also issue summary needs to updated to include that the proposed solution is to deprecate and API changes.

There only appear to be about 10 instances in core. Wonder if this counts as deprecating in D11.

dimitriskr’s picture

Issue summary: View changes
dimitriskr’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Based on slack conversation think this is good.

dimitriskr’s picture

Issue summary: View changes

Cleaned up remaining tasks in IS

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Looks straightforward.

Committed 5294815 and pushed to 11.x. Thanks!

  • longwave committed 52948158 on 11.x
    Issue #3245249 by dimitriskr, smustgrave, kim.pepper: Replace...

longwave’s picture

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Issue status does not want to change.

smustgrave’s picture

Should the CR be published?

longwave’s picture

Yes, whoops, done that as well - thanks!

Status: Fixed » Closed (fixed)

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