Issue Bug Closed

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

Giovanni Romero Pérez 01/03/19, 19:20 updated 04/10/19, 10:03

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Stefanos Karasavvidis commented 01/09/19, 11:13

    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. Anja Leichsenring changed status New Needs Feedback 01/09/19, 11:14

  3. Riccardo De Contardi commented and changed status Needs Feedback Closed 04/10/19, 10:03

    No feedback since the last 90 days => closing this issue.

    If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one.

    Thank you and best regards