Project

General

Profile

Actions

Bug #41487

closed

stdWrap executed twice on GIFBUILDER object properties

Added by Jörg Wagner over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-10-01
Due date:
% Done:

100%

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

Description

This is an intentional duplicate of #25189 to boil down all the findings and discussions and make it easier to see the basic problem and its solution.

Problem

The result of the following TS is a GIF containing the text AAfooBB instead of AfooB.

page.100 = IMAGE
page.100 {
    file = GIFBUILDER
    file {
      10 = TEXT
      10{
        offset = 0,20
        text = foo
        text.wrap = A|B
      }
    }
}

Deeper analysis of the bug shows that all stdWraps of all properties of TEXT objects in GIFBUILDER are done twice!
This double stdWrapping affects GIFBUILDER as well as GMENU objects.
The bug is present in all current versions from 4.5 LTS to 4.7.

Background

This bug was introduced during the extensive overhaul of stdWrap from TYPO3 v4.4 to v4.5.

In the course of this overhaul a great number of stdWrap calls that were spread all over class.tslib_gifbuilder.php have been condensed down into one central stdWrap loop in the tslib_gifBuilder->make() method.

Additionally an identical stdWrap loop was added to tslib_gifBuilder->checkTextObj(). checkTextObj is ONLY called for TEXT objects (as its name implies). checkTextObj() is executed much earlier in the GIFBILDER process than make(), and the reason for having a preliminary stdWrapping there-in is to provide correctly wrapped values for the initial math of all the properties of TEXT objects (like the text width and so on). So this exception is definitely necessary.

In the final make() function the stdWrap loop is executed again for ALL object types. This results in a double wrapping for all TEXT objects.

Solution

The stdWrapping in make() should happen only for objects that are non-TEXT, as TEXT objects have already been stdWrapped in checkTextObj(). An additional if-condition around the stdWrap loop in make() solves the bug easily (see attached patch).


Files


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #25189: GIFBUILDER and splitChar does not work after updateClosed2011-02-26

Actions
Related to TYPO3 Core - Bug #53002: Calculation of GIFBUILDER object properties using stdWrap failsClosed2013-10-21

Actions
Has duplicate TYPO3 Core - Bug #40565: Using listNum in GifBuilder returns empty stringClosedMichael Stucki2012-09-03

Actions
Actions #2

Updated by Jörg Wagner over 11 years ago

Original and patched file were exchanged in my first upload. Here is the correct patch!

Actions #3

Updated by Gerrit Code Review over 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15403

Actions #4

Updated by Gerrit Code Review over 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15403

Actions #5

Updated by Gerrit Code Review over 11 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16865

Actions #6

Updated by Gerrit Code Review almost 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16865

Actions #7

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/20529

Actions #8

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/20530

Actions #9

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/20531

Actions #10

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/20532

Actions #11

Updated by Jörg Wagner almost 11 years ago

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

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/20530

Actions #13

Updated by Jörg Wagner almost 11 years ago

  • Status changed from Under Review to Resolved
Actions #14

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/20532

Actions #15

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/20531

Actions #16

Updated by Jörg Wagner over 10 years ago

  • Status changed from Under Review to Resolved
Actions #17

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF