Project

General

Profile

Actions

Bug #69234

closed

f:cObject doesn't work with object properties

Added by Kevin Ditscheid over 8 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2015-08-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Hi there,
i struggled accross a behaviour in the f:cObject ViewHelper that does not let me access the properties of my domain object.
If i do something like this:

Fluid Template

<f:format.raw>
  <f:cObject typoscriptObjectPath="plugin.ty_myext.content" data={frontendUser: frontendUser} />
</f:format.raw>

Typoscript
plugin.tx_myext{
  content = CONTENT
  content{
    table = tt_content
    select{
      where = colPos=1
      oderBy = sorting
      pidInList = 0
    }
    stdWrap{
      replacement{
        10{
          search = {%frontendUserFirstName}
          replace.dataWrap = {field: frontendUser.firstName}
        }
      }
    }
  }
}

The string "{%frontendUserFirstName}" is found and replaced, but the replacement is an empty string instead of the frontend users first name, that is stored in the domain object of type "\TYPO3\CMS\Extbase\Domain\Model\FrontendUser".
If i do this:
Fluid Template

<f:format.raw>
  <f:cObject typoscriptObjectPath="plugin.ty_myext.content" data={frontendUserFirstName: frontendUser.firstName} />
</f:format.raw>

Typoscript
plugin.tx_myext{
  content = CONTENT
  content{
    table = tt_content
    select{
      where = colPos=1
      oderBy = sorting
      pidInList = 0
    }
    stdWrap{
      replacement{
        10{
          search = {%frontendUserFirstName}
          replace.dataWrap = {field: frontendUserFirstName}
        }
      }
    }
  }
}

everything works as expected. There might be a bug on the domain object handling of the f:cObject ViewHelper, because i thought it can handle domain objects in it's data attribute, as mentioned in the documentation: https://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/CObject.html

I am on TYPO3 6.2.15-dev

Actions

Also available in: Atom PDF