Project

General

Profile

Actions

Bug #45685

closed

EXT:form Fatal error: Call to a member function getValue()

Added by Christian Tauscher almost 12 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2013-02-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I get this Error with EXT:form

Fatal error: Call to a member function getValue() on a non-object in /typo3_src-6.0.2/typo3/sysext/form/Classes/Domain/Model/Attribute/AttributesAttribute.php on line 150

Typo3 6.0.2

Christian


Files

bug_45685.diff (514 Bytes) bug_45685.diff Stefan Weißwange, 2014-04-09 13:59

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #69405: Add Unit Test for BugfixClosedAnja Leichsenring2015-08-29

Actions
Actions #1

Updated by Stefan Weißwange over 10 years ago

Same bug happens with current version (6.1.7).

Attached is a diff, which does a simple check in the method where this error happens. We could not figure out which setting in the form element causes this error.

Actions #2

Updated by Jan Bartels over 10 years ago

Got the same issue on Typo3 6.2.4:

Fatal error: Call to a member function getValue() on a non-object in .../typo3_src-6.2.4/typo3/sysext/form/Classes/Domain/Model/Attribute/AttributesAttribute.php on line 141

Actions #3

Updated by Michael Oehlhof almost 10 years ago

Is this still an issue in 6.2.9 and 7.0?
Can you please add instructions how this error message can be reproduced.

Actions #4

Updated by Björn Jacob over 9 years ago

  • Category set to 1602
  • Status changed from New to Needs Feedback
  • Is Regression set to No

Is this issue still occuring?

Actions #5

Updated by Björn Jacob over 9 years ago

  • Assignee set to Christian Tauscher
Actions #6

Updated by Björn Jacob over 9 years ago

  • Category changed from 1602 to Form Framework
Actions #7

Updated by Björn Jacob over 9 years ago

So far I've found one possibility to reproduce this.

Right now it is not possible to have the following setting.

1000 = SUBMIT
1000 {
  name = submit
}

When not supplying the property value one gets the above mentioned PHP error. Regarding to the SUBMIT element it should be possible not having a value.

We have to find even more use cases to come up with a proper solution.

@Christian: Would still be great if you could name us your use case.

Actions #8

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42774

Actions #9

Updated by Ralf Zimmermann over 9 years ago

There are 3 elements
RESET, SUBMIT and BUTTON
with code like this

TYPO3\CMS\Form\Domain\Model\Element\ButtonElement

public function setValue($value = '') {
    /** @var $localizationHandler \TYPO3\CMS\Form\Localization */
    $localizationHandler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Localization');
    $oldValue = $this->getAttributeValue('value');
    ...
}

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement

public function getAttributeValue($key) {
    /** @var $this->attributes \TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute */
    return $this->attributes->getValue($key);
}

\TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute

public function getValue($key) {
    return $this->getAttributeObjectByKey($key)->getValue();
}

If "value" is not set by Typoscript there is no object for $this->getAttributeObjectByKey('value')

My patchset ist tested with TYPO3 6.2.15-dev and 7.5.0-dev

Actions #10

Updated by Björn Jacob about 9 years ago

  • Assignee deleted (Christian Tauscher)
  • Target version deleted (next-patchlevel)
  • TYPO3 Version changed from 6.1 to 7

The issue can be tested by using the following setup:


enctype = multipart/form-data
method = post
prefix = tx_form
confirmation = 1
postProcessor {
    1 = mail
    1 {
        recipientEmail = 
        senderEmail = 
    }
}
10 = SUBMIT
10 {
    name = 2
}
20 = RESET
20 {
    name = 3
}
30 = BUTTON
30 {
    name = 4
}

Actions #11

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42916

Actions #12

Updated by Ralf Zimmermann about 9 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF