Bug #72252
closedsubstituteMarkerArrayCached not substitute $subpartContentArray
Added by Tobias Klepp almost 9 years ago. Updated about 6 years ago.
100%
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.
Updated by Andreas Kienast almost 9 years ago
- Status changed from New to Needs Feedback
Hi,
thank you for your report. There were two patches related to your report:- BUGFIX Handle content with no markers in substituteMarkerArrayCached
- BUGFIX Avoid overly large regex in substituteMarkerArrayCached
Are you able to investigate which of those patches introduces the regression for you?
Updated by Markus Klein almost 9 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
Updated by Markus Klein almost 9 years ago
- Status changed from Accepted to In Progress
Updated by Markus Klein almost 9 years ago
@Tobias: How do you call the function? Can you provide a code sample please with the data you use for the parameters?
Updated by Gerrit Code Review almost 9 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
Updated by Gerrit Code Review almost 9 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
Updated by Tobias Klepp almost 9 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>
Updated by Markus Klein almost 9 years ago
Ok, the reason is simple... it's the dot!
Updated by Tobias Klepp almost 9 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.
Updated by Gerrit Code Review almost 9 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
Updated by Markus Klein almost 9 years ago
Please test my latest fix! We have to bring that back, we actually overlooked that valid usecase.
Updated by Gerrit Code Review almost 9 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
Updated by Gerrit Code Review almost 9 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
Updated by Markus Klein almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9874706d4be237f6047c4eff6071523a389c50fc.
Updated by Gerrit Code Review almost 9 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
Updated by Gerrit Code Review almost 9 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
Updated by Gerrit Code Review almost 9 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
Updated by Markus Klein almost 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset bfa250a0c5426fc4abb5e7b834a9f01ded612683.
Updated by thomas no-lastname-given almost 9 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
Updated by Markus Klein almost 9 years ago
Followup in #73240.
Please continue any discussion there, thank you.