Project

General

Profile

Actions

Bug #90190

closed

EXT:frontend_editing and EXT:vhs cause exception when used together

Added by Riccardo De Contardi almost 5 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-01-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I write this issue here because it might be also a core problem that could affect third-party code; feel free to close if not pertinent.

Prerequisites:

- TYPO3 9.5.13
- EXT:vhs 6.0.0
- EXT:frontend_editing 1.9.0

EXT:frontend_editing is activated

Steps to reproduce

- Create a page, put in it a content element, hide it (It is actually not necessary, it seems to happen also on empty pages)
- Visit the page on frontend, with the frontend_editing interface activated
- click on the "show hidden content" button:

This leads to an exception:

(1/1) #1384611413 TYPO3Fluid\Fluid\Core\ViewHelper\Exception
No record was found. The "record" or "uid" argument must be specified.

in /Siti/typo3.9.demo.it/public/typo3conf/ext/vhs/Classes/Utility/ErrorUtility.php line 25

     */
    public static function throwViewHelperException($message = null, $code = null)
    {
        if (version_compare(TYPO3_version, '8.0', '>=')) {
            throw new \TYPO3Fluid\Fluid\Core\ViewHelper\Exception($message, $code);
        }
        throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception($message, $code);
    }
}

at FluidTYPO3\Vhs\Utility\ErrorUtility::throwViewHelperException('No record was found. The "record" or "uid" argument must be specified.', 1384611413)

...

I attach here also as a pdf file the full stacktrace (vhs-issue.pdf)

The problem seems actually due to the usage of <v:page.resources.fal> in this way:

<v:page.resources.fal table="pages" field="nav_thumbnail" uid="{item.uid}" as="images">{images.0.alternative}</v:page.resources.fal>

inside one of the page partials: EXT:bhsiteconf/Resources/Private/Partials/Page/Megamenu.html:


<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" 
      xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" 
      data-namespace-typo3-fluid="true">

<div class="accordion-group">
    <v:menu entryLevel="0" levels="1" expandAll="1" >

        <f:for each="{menu}" as="item">

        <f:variable name="alt_thumbnail">
            <v:page.resources.fal table="pages" field="nav_thumbnail" uid="{item.uid}" as="images">{images.0.alternative}</v:page.resources.fal>
        </f:variable>

        <f:variable name="description_thumbnail">
            <v:page.resources.fal table="pages" field="nav_thumbnail" uid="{item.uid}" as="images">{images.0.description}</v:page.resources.fal>
        </f:variable>

            <f:if condition="{item.hasSubPages}">
                <div class="collapse dropdown-mega collapsetoggle" id="a{item.uid}" aria-labelledby="al-{item.uid}">
                    <div class="container--extrawide">
                        <f:if condition="{item.nav_thumbnail}">
                            <div class="dropdown-mega__image-text-container">
                                <img class="dropdown-mega__image img-fluid" src="{f:uri.image(src:item.nav_thumbnail,treatIdAsReference:1,cropVariant:'default',width:'335')} " alt="{alt_thumbnail}" />

                                <f:if condition="{description_thumbnail}">
                                    <div class="dropdown-mega__text">
                                        <p>{description_thumbnail}</p>
                                    </div>                                    
                                </f:if>
                            </div>
                        </f:if>

                        <div class="dropdown-mega__menu-container">
                            <v:menu pageUid="{item.uid}" includeSpacers="1" classActive="menu__item--active" classCurrent="menu__item--active" classHasSubpages="">    
                                <ul class="menu menu--mega">  
                                    <f:for each="{menu}" as="subItem">
                                        <f:if condition="{subItem.doktype} == 199">
                                            <f:then>
                                                </ul><!--separatore--><ul class="menu menu--mega">  
                                            </f:then>
                                            <f:else>
                                                <li class="menu__item {subItem.class}">
                                                    <f:link.page pageUid="{subItem.uid}" title="{subItem.linktext}">{subItem.linktext}</f:link.page>
                                                </li>
                                            </f:else>
                                        </f:if>
                                    </f:for>           
                                </ul>
                            </v:menu>  
                        </div>
                    </div>
                </div>
            </f:if>
        </f:for>
    </v:menu>
</div>

</html>

Changing it to

 <v:page.resources.fal table="pages" field="nav_thumbnail" record="{item}" as="images">{images.0.alternative}</v:page.resources.fal>

Actually solves the problem;

I added two issues on github EXT:vhs and EXT:frontend_editing

Here they are for reference:

https://github.com/FluidTYPO3/vhs/issues/1617

https://github.com/FriendsOfTYPO3/frontend_editing/issues/401

Please look especially at Claus Due's comments like https://github.com/FluidTYPO3/vhs/issues/1617#issuecomment-578091295 and https://github.com/FluidTYPO3/vhs/issues/1617#issuecomment-578092094

Many thanks to the great Claus Due for helping me digging into this problem.


Files

fe_edit.png (28.4 KB) fe_edit.png Riccardo De Contardi, 2020-01-24 12:44
vhs-issue.pdf (315 KB) vhs-issue.pdf Riccardo De Contardi, 2020-01-24 12:45
Actions #1

Updated by Riccardo De Contardi almost 5 years ago

  • Subject changed from Frontend Editing and VHS causes exception to EXT:frontend_editing and EXT:vhs cause exception when used together
Actions #2

Updated by Riccardo De Contardi almost 5 years ago

  • Description updated (diff)
Actions #3

Updated by Susanne Moog over 4 years ago

  • Status changed from New to Rejected

I don't see that as a core problem, I would recommend both extensions - if they manipulate the Context - should use the Context API to avoid clashes between them, even then however, it might be that two extensions trying to achieve similar things might conflict.

Actions

Also available in: Atom PDF