Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Maybe its just our special case. But this sounds more logical to me to set FOCAL_POINT_DEFAULT insead of empty string in hook_file_load. And it solves our specific problem with derivatives.
Comment | File | Size | Author |
---|---|---|---|
#5 | focal_point_disable_flush-2533718-5.patch | 475 bytes | mkolar |
Comments
Comment #1
mkolar CreditAttribution: mkolar commentedPatch...
Comment #2
bleen CreditAttribution: bleen commentedCan you give me some more info about what problem it solves. I'm pretty certain there was a reason for the empty string but Ill have to give this a more thorough look.
Comment #3
mkolar CreditAttribution: mkolar commentedHi bleen, we have the problem if you run following code, it will delete all derivatives for given file_id if there is no data in focal_point table:This patch didn't help in the end. Solution would be to create default data in focal_point table but I don't like it.Ok the problem with save above was because of patch.. Problem without patch is following:
- We have first entity with image which has no data in focal point and has derivatives.
- We have second entity which uses same file to its field.
- After save second entity derivatives are deleted and data filled into focal point, but we don't want this because derivatives are correct (default 50,50)
- Second save works without deletion
Comment #4
mkolar CreditAttribution: mkolar commentedComment #5
mkolar CreditAttribution: mkolar commentedWe need to be able to disable flush...
Comment #6
bleen CreditAttribution: bleen commentedInstead of creating a new variable, can we check the file_managed table to see if the file is being used by more than one entity before flushing?
Comment #7
bleen CreditAttribution: bleen commented...actually, I just looked at #4 and that looks more correct to me.