Bug #87325

Unexpected behavior when there is no text in f:link.page

Added by Giovanni Romero PĂ©rez 3 months ago. Updated 3 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-01-03
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hello. Happy new year!

I'm using the f:link.page view helper. I found that the vh unfolds in a different way than expected when I don't define a text inside it.

For example, I have the following partial:

<div id="my-div">
    <div class="indicator hidden-xs" title="Search">
        <f:link.page pageUid="{searchPageUid}">text</f:link.page>
    </div>
    <div class="my-div-content"></div>
</div>

The result is:

<div id="my-div">
    <div class="indicator hidden-xs" title="Search">
        <a href="/index.php?id=362">text</a>
    </div>
    <div class="my-div-content"></div>
</div>

But, when I don't set any text in the view helper...

<div id="my-div">
    <div class="indicator hidden-xs" title="Search">
        <f:link.page pageUid="{searchPageUid}"></f:link.page>
    </div>
    <div class="my-div-content"></div>
</div>

The result is:

<div id="my-div">
    <div class="indicator hidden-xs" title="Search">
        <a href="/index.php?id=362">
    </a></div><a href="/index.php?id=362">
    <div class="my-div-content"></div>
</a></div>
<a href="/index.php?id=362">

</a>

Thanks.

History

#1 Updated by Stefanos Karasavvidis 3 months ago

I tried your example on the latest master, on current LTS 9 and LTS 8, and can't reproduce it.

In all cases, I get just a single empty a tag of the form

<a href="/index.php?id=362" />

The complete generated code is

    <div id="my-div">
        <div class="indicator hidden-xs" title="Search">
            <a href="index.php?id=1" />
        </div>
        <div class="my-div-content"></div>
    </div>

Note the self closing /> at the end of the a element. It doesn't make sense, but is valid. There are no additional a tags generated.

Please also note that the browser may get confused and use following elements as part of the link. But that would be a browser issue.

So could you please elaborate on your test case and make it more specific? Make also sure to view the generated source, and not try to use your browsers element inspector to view the generated source.

#2 Updated by Anja Leichsenring 3 months ago

  • Status changed from New to Needs Feedback

Also available in: Atom PDF