In EE3, {assets_field:url:[manipulation_name]} used to work but does not work in EE4.
I’ve tested it and it looks like EE4 is calling pre_process() in the ft.assets.php file when the tag is just the {[field_name]:[attribute]} but not when it’s {[field_name]:[attribute]:[manipulation_name]}. It shows no difference in the Template Debugging Output between the two tags and doesn’t show whether it calls pre_process() or not.
To Reproduce: - Add an image manipulation to a File Upload Directory - Upload an image into that File Upload Directory - Add an Assets field to a channel - Add an entry and choose an uploaded file from the File Upload Directory with the manipulation (or upload a new one) - In a template, use the following code (assuming your field is “Assets Field” and your manipulation is “sized”):
{exp:channel:entries dynamic="no" entry_id="your_id"}
{!-- This does not work in EE4 (but does in EE3) --}
{assets_field:url:sized}
{!-- This works in both EE3 and EE4 --}
{assets_field:url}
{!-- This _does_ work in EE4 but breaks legacy template code for users --}
{assets_field}
{url:sized}
{/assets_field}
{/exp:channel:entries}
I think I have an idea of what may have caused this. Can you open system/ee/EllisLab/ExpressionEngine/Service/Template/LegacyParser.php and find this code on line 51:
$modifier_loc = strrpos($field_name, ':');
And REPLACE it with this:
$modifier_loc = strpos($field_name, ':');
That’s not the proper fix for this, it’s just to confirm the issue, then we’ll figure out how/if we want to support this.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.