Bug #10136

Localisation class possibly not properly initialised

Added by Christian Lerrahn almost 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Must have
Category:
I18n
Start date:
2010-10-07
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

The context this bug occurs in is one of a manually validated object. The code is

$validator = $this->validatorResolver->getBaseValidatorConjunction('F3\Package\Domain\Model\Asset');
if ($validator->isValid($currentAsset)) {...

This results in an exception
#1: Catchable Fatal Error: Argument 2 passed to F3\FLOW3\I18n\Parser\NumberParser::parseDecimalNumber() must be an instance of F3\FLOW3\I18n\Locale, null given,...

If I'm not mistaken the class is never properly initialised. The initialize() method is supposed to create the object which is NULL here but fails to do so.


Related issues

Related to TYPO3.Flow - Bug #10206: Cache handling is broken in I18nResolvedKarsten Dambekalns2010-10-11

Actions
Related to TYPO3.Flow - Bug #10205: Object initialization is misused in I18nResolvedKarsten Dambekalns2010-10-11

Actions
#1

Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Karsten Dambekalns

True, the I18n system is not yet activated during bootstrap. You seem to be using some validator that relies on I18n - didn't ever think about that being used although I18n is not active. :)

Could you try activating it in Bootstrap.php and see if everything works as expected then?

#2

Updated by Karsten Dambekalns almost 11 years ago

  • Target version deleted (1.0 alpha 12)

Karsten Dambekalns wrote:

Could you try activating it in Bootstrap.php and see if everything works as expected then?

Remove the comment in initializeLocale() - and if you do, make sure all active packages have a Resources folder (can be empty). It fails otherwise...

#3

Updated by Christian Lerrahn almost 11 years ago

I tried what you suggested and it only gets me there half-way, I suspect. I now see an exception

RecursiveDirectoryIterator::__construct(resource://Party/): failed to open dir: "\F3\FLOW3\Resource\Streams\StreamWrapperAdapter::dir_opendir" call failed

even though there is only one package installed which has a Resources folder.

The line
$directoryIterator = new \RecursiveDirectoryIterator($this->localeBasePath . $activePackage->getPackageKey() . '/');

also seems to suggest that this path should be different because "Party" is not the package name. But maybe I'm wrong about that...

#4

Updated by Karsten Dambekalns almost 11 years ago

Christian Lerrahn wrote:

I tried what you suggested and it only gets me there half-way, I suspect. I now see an exception

RecursiveDirectoryIterator::__construct(resource://Party/): failed to open dir: "\F3\FLOW3\Resource\Streams\StreamWrapperAdapter::dir_opendir" call failed

even though there is only one package installed which has a Resources folder.

No, the Party package also has no Resources folder, simply add an empty one.

The line
$directoryIterator = new \RecursiveDirectoryIterator($this->localeBasePath . $activePackage->getPackageKey() . '/');
also seems to suggest that this path should be different because "Party" is not the package name. But maybe I'm wrong about that...

Party is a package in the Framework, that's fine.

#5

Updated by Christian Lerrahn almost 11 years ago

Well, this does solve the problem at this point but the next exception I see still seems to be linked to localisation.

Tried to create instance of class F3\FLOW3\Cache\Frontend\VariableFrontend without passing constructor argument $identifier in Packages/Framework/FLOW3/Classes/I18n/Cldr/CldrRepository.php line 155.

This exception is triggered by the same validator. :( This is a simple Number validator in the model, only that I build the class validator manually because the input comes from a file. I'm a bit surprised that that would go wrong if everything is really supposed to work without localisation.

#6

Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from Needs Feedback to Accepted
  • Target version set to 1.0 alpha 13
#7

Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from Accepted to Under Review
#8

Updated by Karsten Dambekalns almost 11 years ago

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

Also available in: Atom PDF