Problem/Motivation

There are some modules will take an action to change URI while file is uploading to the system, for example file field path module (https://www.drupal.org/project/filefield_paths) will save file in to entity-based token destination.

Proposed resolution

Reload image since its URI could have been changed by other modules while Focal point getCropEntity.

Remaining tasks

  • ✅ Create MR
  • Test/Review
  • Merge

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

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

tvhung created an issue. See original summary.

henry tran’s picture

henry tran’s picture

StatusFileSize
new1.84 KB
henry tran’s picture

Restructure code dependence injection.

henry tran’s picture

Fix coding standard.

Status: Needs review » Needs work
nuuou’s picture

I actually had this exact same issue, I believe!

I added a fairly naïve patch here, but it looks like you're going down a better path probably! Also nice to see that someone else is able to replicate this same issue.

https://www.drupal.org/project/focal_point/issues/3008727

majdi’s picture

I face the same issue, after applying the patch everything works fine

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

justcaldwell’s picture

Assigned: henry tran » Unassigned
Issue summary: View changes
Status: Needs work » Needs review

We use File (Field) Paths and were experiencing this issue. The solution works perfectly. Thank you!

I created MR!61 based on patch 4 (from comment #5).

justcaldwell’s picture

Title: Focal point will not take in effect if others module changed URI while saving image entity at the first time. » Focal point location is not saved if others module change URI on first save.