Bug #82249

Cache problems on flexform when using "Content from pid" feature

Added by José Ricardo over 2 years ago. Updated about 1 month ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2017-08-30
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Hi,

On TYPO 8.7.4, i have a page X which renders the content of another page Y (field content_from_pid).
On page Y i have a content with a flexform and two fields (text and image), as shown below.

When I edit this content on TYPO3, the page X shows the image changed but the text unchanged.
Page Y shows both changed.
Using ?no_cache=1 on X shows both changed.

So, it looks like TYPO3 is making cache of the flexform, but only in the page X.
The image changes on frontend because it is retrieved from the database (as the flexform contains only the number '1' and not the image or reference uids).

I get the image using these lines of code:

$fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
$image = $fileRepository->findByRelation('tt_content', 'featured_image', $contentUid);

Here's the flexform i'm using.

<sFEATUREDNEWS>
    <ROOT>
        <TCEforms>
            <sheetTitle>Featured News</sheetTitle>
        </TCEforms>
        <type>array</type>
        <el>
            <title>
                <TCEforms>
                    <label>Title</label>
                    <config>
                        <type>input</type>
                        <size>48</size>
                        <eval>trim</eval>
                    </config>
                </TCEforms>
            </title>
            <featured_image>
                <TCEforms>
                    <label>Image</label>
                    <config>
                        <type>inline</type>
                        <appearance type="array">
                            <enabledControls type="array">
                                <delete>1</delete>
                                <dragdrop>1</dragdrop>
                                <hide>1</hide>
                                <info>1</info>
                                <localize>1</localize>
                            </enabledControls>
                            <headerThumbnail type="array">
                                <field>uid_local</field>
                                <height>45c</height>
                                <width>45</width>
                            </headerThumbnail>
                            <useSortable>1</useSortable>
                        </appearance>
                        <behaviour type="array">
                            <localizationMode>select</localizationMode>
                            <localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
                        </behaviour>
                        <filter type="array">

                        </filter>
                         <foreign_types type="array">
                            <numIndex index="2" type="array">
                                <showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
                            </numIndex>
                        </foreign_types>
                        <foreign_table>sys_file_reference</foreign_table>
                        <foreign_sortby>sorting_foreign</foreign_sortby>
                        <foreign_table_field>tablenames</foreign_table_field>
                        <foreign_field>uid_foreign</foreign_field>
                        <foreign_label>uid_local</foreign_label>
                        <foreign_match_fields type="array">
                            <fieldname>featured_image</fieldname>
                        </foreign_match_fields>
                        <foreign_selector>uid_local</foreign_selector>
                        <foreign_selector_fieldTcaOverride type="array">
                            <config type="array">
                                <appearance type="array">
                                    <elementBrowserAllowed>gif,jpg,jpeg,png</elementBrowserAllowed>
                                    <elementBrowserType>file</elementBrowserType>
                                </appearance>
                            </config>
                        </foreign_selector_fieldTcaOverride>
                        <maxitems>1</maxitems>
                        <minitems>0</minitems>
                    </config>
                </TCEforms>
            </featured_image>            
        </el>
    </ROOT>
</sFEATUREDNEWS>

Cheers

82249-content-from-pid-typo3-9.diff View (992 Bytes) Olaf Schmidt-Wischhöfer, 2019-10-24 16:06

82249-content-from-pid-typo3-8.diff View (817 Bytes) Olaf Schmidt-Wischhöfer, 2019-10-24 16:06

82249-content-from-pid-master.diff View (935 Bytes) Olaf Schmidt-Wischhöfer, 2019-10-24 16:06


Related issues

Related to TYPO3 Core - Bug #59411: Forward: Clear cache for pages content_from_pid New 2014-06-08
Related to TYPO3 Core - Bug #18534: The cache of pages which include content from another one is not emptied automatically when source content is edited New 2008-04-01

History

#1 Updated by Olaf Schmidt-Wischhöfer about 1 month ago

I have attached patches that fix this issue for various branches.

#2 Updated by Olaf Schmidt-Wischhöfer about 1 month ago

  • Related to Bug #59411: Forward: Clear cache for pages content_from_pid added

#3 Updated by Olaf Schmidt-Wischhöfer about 1 month ago

  • Related to Bug #18534: The cache of pages which include content from another one is not emptied automatically when source content is edited added

#4 Updated by Olaf Schmidt-Wischhöfer about 1 month ago

  • Complexity set to easy

Also available in: Atom PDF