Issue Bug Closed

#82574Inconsistent support of config.absRefPrefix in fluid/extbase

Rémy DANIEL 09/28/17, 10:23 updated 12/02/25, 14:36

Description

Hi

As an integrator I would like to see config.absRefPrefix used everywhere in the same way over my templates.

When building an uri with typolink: OK, absRefPrefix is prepended to the uri
When building an uri for an image with f:uri.image: OK, absRefPrefix is prepended to the uri
When building an uri for a resource with f:uri.resource: not OK, absRefPrefix is not prepended to the uri

Would it be possible to have a consistent usage of config.absRefPrefix all over fluid/extbase/cObj ?

Cheers

Perhaps related tickets: #81486, #82486, #77722

Reviews 2

History 1434

Show 9 earlier messages
  1. Rémy DANIEL commented <span data-processor="relativetime" data-value="2017-09-28T11:12:58+00:00" > 09/28/17, 11:12 </span>

    Something also weird. In a fluid template:

    <img src="{f:uri.resource(...)}" />
     --> output an uri correctly prefixed with absRefPrefix
    
    <div style="background-image: url({f:uri.resource(...)))"></div>
     --> uri is not prefixed with absRefPrefix
  2. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2019-10-27T00:07:55+00:00" > 10/27/19, 00:07 </span>

    Test done with 9.5.0 and:

    - an image EXT:siteconf/Resources/Public/Assets/Images/sample1.png
    - TS Setup:

    config {
      absRefPrefix = /foo/
    } 
    Fluid code Result Absrefprexix applied?
    <img src="{f:uri.resource(path:'Assets/Images/sample1.png')}" /> <img src="/typo3conf/ext/siteconf/Resources/Public/Assets/Images/sample1.png" /> NO
    <div style="background-image: url({f:uri.resource(path:'Assets/Images/sample1.png')})"></div> <div style="background-image: url(/typo3conf/ext/siteconf/Resources/Public/Assets/Images/sample1.png)"></div> NO
    <f:uri.image src="EXT:siteconf/Resources/Public/Assets/Images/sample1.png" /> /foo/typo3conf/ext/siteconf/Resources/Public/Assets/Images/sample1.png YES
    {f:uri.image(src:'EXT:siteconf/Resources/Public/Assets/Images/sample1.png')} /foo/typo3conf/ext/siteconf/Resources/Public/Assets/Images/sample1.png YES

    Moreover, the absolute parameter seems to work only for f:uri.image and is ignored for f:uri.resource albeit the documentation mentions it: https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Uri/Resource.html#absolute

    Look also at https://review.typo3.org/c/Packages/TYPO3.CMS/+/41682/

  3. Christian Weiske commented <span data-processor="relativetime" data-value="2023-05-09T13:26:40+00:00" > 05/09/23, 13:26 </span>

    Using <f:asset.script src="EXT:myext/file.js"> fails to take absRefPrefix into account on TYPO3 v11.5.25.

  1. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2024-12-10T14:57:07+00:00" > 12/10/24, 14:57 </span>

    Can you recheck with v13 now please?

  2. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2024-12-12T15:58:17+00:00" > 12/12/24, 15:58 </span>

    I repeated the test on my comment #3 on version 13.4.2:

    TS Setup

    config {
      absRefPrefix = /foo/
    } 

    and the result looks pretty much the same:

    Fluid code Result Absrefprexix applied?
    <img src="{f:uri.resource(path:'EXT:siteconf/Resources/Public/Assets/Images/sample1.png')}" /> <img src="/_assets/b1172fb14b6ddce973de6fe465238c63/Assets/Images/sample1.png
    " />
    NO
    <div style="background-image: url({f:uri.resource(path:'EXT:siteconf/Resources/Public/Assets/Images/sample1.png')})"></div> <div style="background-image: url(/_assets/b1172fb14b6ddce973de6fe465238c63/Assets/Images/sample1.png)"></div> NO
    <f:uri.image src="EXT:siteconf/Resources/Public/Assets/Images/sample1.png" /> /foo/_assets/b1172fb14b6ddce973de6fe465238c63/Assets/Images/sample1.png
    YES
    {f:uri.image(src:'EXT:siteconf/Resources/Public/Assets/Images/sample1.png')} /foo/_assets/b1172fb14b6ddce973de6fe465238c63/Assets/Images/sample1.png
    YES

    Note

    the absolute parameter now works for both f:uri.image and f:uri.resource

  3. Benni Mack commented and changed status Needs Feedback Accepted <span data-processor="relativetime" data-value="2024-12-12T20:45:35+00:00" > 12/12/24, 20:45 </span>

    Completely valid (and I hate it :)).

    Here we go:
    - f:uri.image takes the src attribute and considers this a FAL object, so FAL API is applied. However, the “problem” is that FAL considers this “fallback storage” which is the main problem here.
    - f:uri.resource considers this a “file or folder somewhere on the TYPO3 installation” which IMHO is correct (as absRefPrefix is not applied AFAIK).

    So the real solution is to get rid of this fallback storage concept first.

    One other solution would be to fix the “applyAbsRefPrefix” to check for “/_assets” nowadays as well.

  4. Gerrit Code Review pushed patch set 65 for main to change 90675 status Accepted Under Review <span data-processor="relativetime" data-value="2025-10-22T10:02:16+00:00" > 10/22/25, 10:02 </span>

  5. Helmut Hummel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-10-25T19:35:10+00:00" > 10/25/25, 19:35 </span>

    Applied in changeset commit:5d637429cff45078d813436dd289aab6dd24a91b.