Project

General

Profile

Actions

Bug #82249

closed

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

Added by José Ricardo about 7 years ago. Updated over 4 years ago.

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

100%

Estimated time:
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


Files

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

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #59411: Forward: Clear cache for pages content_from_pidClosed2014-06-08

Actions
Related to TYPO3 Core - Bug #18534: The cache of pages which include content from another one is not emptied automatically when source content is editedClosed2008-04-01

Actions
Related to TYPO3 Core - Bug #18534: The cache of pages which include content from another one is not emptied automatically when source content is editedClosed2008-04-01

Actions

Updated by Olaf Schmidt-Wischhöfer about 5 years ago

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

Actions #2

Updated by Olaf Schmidt-Wischhöfer about 5 years ago

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

Updated by Olaf Schmidt-Wischhöfer about 5 years 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
Actions #4

Updated by Olaf Schmidt-Wischhöfer about 5 years ago

  • Complexity set to easy
Actions #5

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63531

Actions #6

Updated by Benni Mack over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63536

Actions #8

Updated by Georg Ringer over 4 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Benni Mack over 4 years 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
Actions #10

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF