Project

General

Profile

Actions

Bug #72252

closed

substituteMarkerArrayCached not substitute $subpartContentArray

Added by Tobias Klepp over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Frontend
Start date:
2015-12-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

Description

After updating TYPO3 CMS to 6.2.16 from 6.2.15 all my extensions that uses substituteMarkerArrayCached no longer working. The third parameter $subpartContentArray will be not considered. This is a fatal problem and I must go back to TYPO3 CMS 6.2.15.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #72224: problems introduced by bugfix 44270ClosedMarkus Klein2015-12-14

Actions
Related to TYPO3 Core - Bug #44270: wrong result in substituteMarkerArrayCachedClosedFranz Holzinger2013-01-02

Actions
Related to TYPO3 Core - Bug #73240: substituteMarkerArrayCached completely broken in TYPO3 6.2.17Closed2016-02-11

Actions
Actions #1

Updated by Andreas Kienast over 8 years ago

  • Status changed from New to Needs Feedback

Hi,

thank you for your report. There were two patches related to your report:

Are you able to investigate which of those patches introduces the regression for you?

Actions #2

Updated by Markus Klein over 8 years ago

  • Category set to Frontend
  • Status changed from Needs Feedback to Accepted
  • Assignee set to Markus Klein
  • Target version changed from 6.2.16 to Candidate for patchlevel
  • Complexity set to medium
  • Is Regression changed from No to Yes
Actions #3

Updated by Markus Klein over 8 years ago

  • Status changed from Accepted to In Progress
Actions #4

Updated by Markus Klein over 8 years ago

@Tobias: How do you call the function? Can you provide a code sample please with the data you use for the parameters?

Actions #5

Updated by Gerrit Code Review over 8 years ago

  • Status changed from In Progress 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/45319

Actions #6

Updated by Gerrit Code Review over 8 years ago

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

Actions #7

Updated by Tobias Klepp over 8 years ago

Markus Klein wrote:

@Tobias: How do you call the function? Can you provide a code sample please with the data you use for the parameters?

Hello Markus,

here is an example PHP plugin code:

/**
 * Example plugin view
 *
 * @return    string        The html content for the plugin view
 */
private function exampleView() {

    // Set variables
    $subpart['###view.item###'] = '';

    // Replace the marker
    $marker['###marker###'] = 'Hello World!';

    // Loop through items
    for ($i = 0; $i < 3; $i++) {

        // Replace the marker
        $markerItem['###item###'] = 'Item '.$i;

        // Substitute the marker
        $subpart['###view.item###'] .= $this->cObj->substituteMarkerArrayCached(
            $this->cObj->getSubpart($this->template, '###view.item###'),
            $markerItem
        );
    }

    // Substitute the marker and subparts
    return $this->cObj->substituteMarkerArrayCached(
        $this->cObj->getSubpart($this->template, '###view###'),
        $marker,
        $subpart
    );
}

This is the template:

<!-- ###view### begin -->
<h1>###marker###</h1>
<ul>
    <!-- ###view.item### begin -->
    <li>###item###</li>
    <!-- ###view.item### end -->
</ul>
<!-- ###view### end -->

The marker arrays working fine, but the subpart array will be not considered. The result is, that the subparts are not substituted correctly.

The result looks like this:

<h1>Hello World!</h1>
<ul>
    ###view.item###
</ul>
Actions #8

Updated by Markus Klein over 8 years ago

Ok, the reason is simple... it's the dot!

Actions #9

Updated by Tobias Klepp over 8 years ago

I make a quick test and remove the dot in the subpart name and it works fine. It is possible to bring back the behaviour of TYPO3 6.2.15? Otherwise I need to change all my extension templates.

Actions #10

Updated by Gerrit Code Review over 8 years ago

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

Actions #11

Updated by Markus Klein over 8 years ago

Please test my latest fix! We have to bring that back, we actually overlooked that valid usecase.

Actions #12

Updated by Gerrit Code Review over 8 years ago

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

Actions #13

Updated by Gerrit Code Review over 8 years ago

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

Actions #14

Updated by Markus Klein over 8 years ago

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

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45336

Actions #16

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45336

Actions #17

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45336

Actions #18

Updated by Markus Klein over 8 years ago

  • Status changed from Under Review to Resolved
Actions #19

Updated by thomas no-lastname-given over 8 years ago

Hello,

issue with TYPO3 vers. 6.2.17 and "ContentObjectRenderer.php" that came with.
php: 5.4.42

Together with tt_products not all markers form the html-template have been replaced.
We discovered here: a known incident.

We try the "ContentObjectRenderer.php" from "github.com/TYPO3/TYPO3.CMS/tree/master/typo3/sysext/frontend/Classes/ContentObject" now 23 hours old, but this one causes an emtpy page with:
"Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /html/typo3/typo3_src-6.2.17/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php on line 587"

After discussion with the maintainer of tt_products, we have used the "ContentObjectRenderer.php" from TYPO3 vers. 6.2.12 and
all works fine.

with regards
thomas

Actions #20

Updated by Markus Klein about 8 years ago

Followup in #73240.

Please continue any discussion there, thank you.

Actions #21

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF