Problem/Motivation

We are cleaning up the file.module and file_get_content_headers() can be moved to a method on the file entity.

Steps to reproduce

Proposed resolution

Move the contents of file_get_content_headers() to a method on the file entity and deprecate.

Remaining tasks

Update CR

User interface changes

N/A

Introduced terminology

N/A

API changes

Data model changes

N/A

Release notes snippet

N/A

Issue fork drupal-3494126

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.

kim.pepper’s picture

Issue tags: +Novice

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

ramprassad’s picture

Assigned: Unassigned » ramprassad

@Kim, Sure I will update my changes for the MR in sometime and provide an update

ramprassad’s picture

Issue tags: +Needs change record
ramprassad’s picture

@Kim, I have updated the MR with the changes and created a change record for this change https://www.drupal.org/node/3494172. All tests pass.

ramprassad’s picture

Assigned: ramprassad » Unassigned
Status: Active » Needs review
ramprassad’s picture

Status: Needs review » Needs work
ramprassad’s picture

Status: Needs work » Needs review
kim.pepper’s picture

Status: Needs review » Needs work
Issue tags: -Needs change record +Needs tests

Left some comments.

nicxvan’s picture

If you added the needs tests tag to test the deprecation we don't need tests for that.

https://www.drupal.org/about/core/policies/core-change-policies/how-to-d...

If it's for something else let me know.

I left this on the MR too just because I sometimes miss the comments at the bottom of the overview page.

ramprassad’s picture

Status: Needs work » Needs review
rohan_singh’s picture

Status: Needs review » Needs work

+1, I agree with @kimpepper.
Renaming the function name to getDownloadHeaders() sounds better and justifies the functionality implemented.

Moving this to needs work.

ramprassad’s picture

Status: Needs work » Needs review

@Kim, I have changed the method name to getDownloadHeaders().
Moving this to review, please check.

smustgrave’s picture

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

Small comment on MR
CR needs to be updated for 11.2 also

May count as an API change? If yes that section should be updated

Thanks

ramprassad’s picture

@kim,@smustgrave: The merge conflicts from the 11.x rebase on this MR has been resolved and I fixed few CI issues related to the 11.x changes in this MR. I had updated the CR related to this change as well. Please check

ramprassad’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Need rebase.

But typehint can be added to the hook so we don’t need to add to the baseline

ramprassad’s picture

Status: Needs work » Needs review

@smustgrave, I have made the necessary changes, please check.

berdir’s picture

Reviewed.

smustgrave’s picture

Status: Needs review » Needs work

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

karimb’s picture

Status: Needs work » Needs review
nicxvan’s picture

One issue with the deprecation, if you can apply my suggestion I see no other issues after reviewing this, I can RTBC after this.

nicxvan’s picture

Status: Needs review » Needs work
karimb’s picture

Status: Needs work » Needs review

Done! Nice catch @nicxvan! Thx ;)

nicxvan changed the visibility of the branch 11.x to hidden.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

Looks great now thanks!

catch’s picture

Title: Move file_get_content_headers() to a static method on a utility class » Move file_get_content_headers() to a method on the file entity
Issue summary: View changes

  • catch committed c742c881 on 11.x
    Issue #3494126 by ramprassad, karimb, nicxvan, kim.pepper, smustgrave,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

Status: Fixed » Closed (fixed)

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