anguish
anguish

Reputation: 458

TYPO3 7.6.x Class 'TYPO3\Flow\Error\Message' not found

I want to override the getErrorFlashMessage method in my action but getting the error message Class 'TYPO3\Flow\Error\Message' not found.

/**
 * @return \TYPO3\Flow\Error\Message
 */
protected function getErrorFlashMessage() {
 switch ($this->actionMethodName) {
  case 'createAction' :
   return new \TYPO3\Flow\Error\Message(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_myext_domain_model_test.createError', 'myext' ));
  default:
   return parent::getErrorFlashMessage();
 }
}

Upvotes: 0

Views: 120

Answers (2)

anguish
anguish

Reputation: 458

I changed the return type to string and returning a string, now its working.

return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_myext_domain_model_test.createError', 'myext' );

Upvotes: 0

Daniel
Daniel

Reputation: 7016

There is no such class in TYPO3 7.6.

Try \TYPO3\CMS\Extbase\Error\Message instead.

Upvotes: 1

Related Questions