Bug #33024

Exception when validating a float in a Model with the Number validator

Added by Jonny over 9 years ago. Updated over 9 years ago.

Status:
Accepted
Priority:
Must have
Category:
I18n
Target version:
-
Start date:
2012-01-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

Warning: array_merge(): Argument #1 is not an array in /Data/Temporary/Development/Cache/Code/FLOW3_Object_Classes/TYPO3_FLOW3_I18n_Cldr_CldrModel_Original.php line 356
29 TYPO3\FLOW3\Error\ErrorHandler::handleError(2, "array_merge(): Argument #1 is not an array", "asses/TYPO3_FLOW3_I18n_Cldr_CldrModel_Original.php", 356, array)

28 array_merge(boolean, array)

27 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::resolveAliases(array, "dates/calendars/calendar[@type="roc"]/dateTimeFormats/dateTimeFormatLength")

26 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::resolveAliases(array, "dates/calendars/calendar[@type="roc"]/dateTimeFormats")

25 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::resolveAliases(array, "dates/calendars/calendar[@type="roc"]")

24 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::resolveAliases(array, "dates/calendars")

23 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::resolveAliases(array, "dates")

22 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::resolveAliases(array, "")

21 TYPO3\FLOW3\I18n\Cldr\CldrModel_Original::initializeObject(1)

20 TYPO3\FLOW3\I18n\Cldr\CldrModel::__construct(array)

19 TYPO3\FLOW3\I18n\Cldr\CldrRepository_Original::getModelForLocale(TYPO3\FLOW3\I18n\Locale)

18 TYPO3\FLOW3\I18n\Cldr\Reader\NumbersReader_Original::parseFormatFromCldr(TYPO3\FLOW3\I18n\Locale, "decimal", "default")

17 TYPO3\FLOW3\I18n\Parser\NumberParser_Original::parseDecimalNumber(0, TYPO3\FLOW3\I18n\Locale, "default", boolean)

16 TYPO3\FLOW3\Validation\Validator\NumberValidator_Original::isValid(0)

15 TYPO3\FLOW3\Validation\Validator\AbstractValidator::validate(0)

14 TYPO3\FLOW3\Validation\Validator\GenericObjectValidator_Original::checkProperty(0, SplObjectStorage, TYPO3\FLOW3\Error\Result)

13 TYPO3\FLOW3\Validation\Validator\GenericObjectValidator_Original::validate(Spielmeister\Common\Domain\Model\Transaction)

12 TYPO3\FLOW3\Validation\Validator\ConjunctionValidator_Original::validate(Spielmeister\Common\Domain\Model\Transaction)

11 TYPO3\FLOW3\Persistence\Doctrine\PersistenceManager_Original::validateObject(Spielmeister\Common\Domain\Model\Transaction)

10 TYPO3\FLOW3\Persistence\Doctrine\PersistenceManager_Original::onFlush(Doctrine\ORM\Event\OnFlushEventArgs)

9 Doctrine\Common\EventManager::dispatchEvent("onFlush", Doctrine\ORM\Event\OnFlushEventArgs)

8 Doctrine\ORM\UnitOfWork::commit()

7 Doctrine\ORM\EntityManager::flush()

6 TYPO3\FLOW3\Persistence\Doctrine\PersistenceManager_Original::persistAll("TYPO3\FLOW3\Core\Bootstrap::finishedRuntimeRun")

5 call_user_func_array(array, array)

4 TYPO3\FLOW3\SignalSlot\Dispatcher::dispatch("TYPO3\FLOW3\Core\Bootstrap", "finishedRuntimeRun", array)

3 TYPO3\FLOW3\Core\Bootstrap::emitFinishedRuntimeRun()

2 TYPO3\FLOW3\Core\Bootstrap::handleWebRequest()

1 TYPO3\FLOW3\Core\Bootstrap::run()

In Model:

    /**
     * The value
     * @var float
     * @FLOW3\validate(type="Number")
     */
    protected $value;

    /**
     *
     * @param float $value 
     * @return void
     */
    public function setValue($value) {
        $this->value = floatval($value);
    }

When trying to persistent a Model with this Validation, i throws this Exception as shown.

I Think it may have something to do with the localization.

When changing it to float validation, it works fine.

#1

Updated by Karsten Dambekalns over 9 years ago

  • Category changed from - Error Handler Report - to I18n
  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Priority changed from -- undefined -- to Must have

Also available in: Atom PDF