Project

General

Profile

Actions

Bug #43451

closed

Existing implementation of txCmsLayoutDrawItemHook fails in 6.0

Added by Martin Ficzel almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-11-29
Due date:
% Done:

0%

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

Description

If i implemment the following hook compatible with 4.x i get a fatal PHP-Error. Im running TYPO3 6.0 on php 5.3.6.

Error:

Fatal error: Declaration of tx_t3_default_resources_txCmsLayoutDrawItemHook::preProcess() must be compatible with that of TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface::preProcess() in /Users/martin/Public/localhost/t3_default/www-data/typo3conf/ext/t3_default_resources/Classes/Hooks/txCmsLayoutDrawItemHook.php on line 4

Hook:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']

Old implementation that fails in 6.0:

class tx_t3_default_resources_txCmsLayoutDrawItemHook implements tx_cms_layout_tt_content_drawItemHook {
  public function preProcess(tx_cms_layout &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row){
  }
}

New namespaced implementation that works but is incompatible with 4.x:

class tx_t3_default_resources_txCmsLayoutDrawItemHook implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface {
  public function preProcess(tx_cms_layout &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row){
  }
}

So currently it is not possible to implement this hook for 4.x and 6.0.

Regards Martin


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #40653: Namespace interfaces don't work for PHP version < 5.3.7 due to type hinting issuesClosed2012-09-05

Actions
Related to TYPO3 Core - Bug #42963: preProcess() hook invoking in some extensions in PageLayoutViewDrawItemHook failsClosed2012-11-14

Actions
Actions

Also available in: Atom PDF