Project

General

Profile

Actions

Bug #31652

closed

Fatal error: Call to a member function getValue() [Attributes.php line 154]

Added by Benjamin bunse about 13 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2011-11-07
Due date:
% Done:

0%

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

Description

I created a form (Form version 0.9.0) using the new form wizard in Typo3 4.6.0.

enctype = multipart/form-data
method = post
prefix = tx_form
confirmation = 1
postProcessor {
    1 = mail
    1 {
        recipientEmail = email@domain.com
        senderEmail = another-email@another-domain.com
    }
}
10 = RADIOGROUP
10 {
    class = fieldset-subgroup
    legend {
        value = Geschlecht
    }
    name = Geschlecht
    10 = RADIO
    10 {
        label {
            value = Frau
        }
    }
    20 = RADIO
    20 {
        label {
            value = Herr
        }
    }
}
20 = TEXTLINE
20 {
    name = Titel
    label {
        value = Titel
    }
}
30 = TEXTLINE
30 {
    name = Nachname
    label {
        value = Nachname
    }
}
40 = TEXTLINE
40 {
    name = Vorname
    label {
        value = Vorname
    }
}
50 = TEXTLINE
50 {
    name = E-Mail
    label {
        value = E-Mail
    }
}
60 = TEXTLINE
60 {
    name = Telefon
    label {
        value = Telefon
    }
}
70 = TEXTLINE
70 {
    name = Unternehmen
    label {
        value = Unternehmen / Organisation
    }
}
80 = TEXTLINE
80 {
    name = Funktion
    label {
        value = Funktion
    }
}
90 = TEXTLINE
90 {
    name = Straße
    label {
        value = Straße
    }
}
100 = TEXTLINE
100 {
    name = PLZ
    label {
        value = PLZ
    }
}
110 = TEXTLINE
110 {
    name = Ort
    label {
        value = Ort
    }
}
120 = TEXTLINE
120 {
    name = Land
    label {
        value = Land
    }
}
130 = TEXTBLOCK
130 {
    class = content-textblock
    content = Mit * markierte Felder sind erforderlich.<br>Diese Angaben benötigen wir, um mit Ihnen Kontakt aufzunehmen.
}
140 = TEXTAREA
140 {
    cols = 30
    rows = 5
    name = Nachricht
    label {
        value = Bitte tragen Sie hier Ihre Nachricht an uns ein.
    }
}
150 = RADIOGROUP
150 {
    class = fieldset-subgroup
    name = Datenschutz
    10 = RADIO
    10 {
        label {
            value = Ich habe die Bestimmungen zum Datenschutz sowie die rechtlichen Hinweise im Impressum zur Kenntnis genommen und akzeptiere diese.
        }
    }
}
160 = SUBMIT
160 {
    name = 21
    value = Senden
}
rules {
    1 = required
    1 {
        breakOnError = 0
        showMessage = 1
        message = *
        error = Das Feld ist erforderlich.
        element = Geschlecht
    }
    2 = required
    2 {
        breakOnError = 0
        showMessage = 1
        message = *
        error = Das Feld ist erforderlich.
        element = Nachname
    }
    3 = required
    3 {
        breakOnError = 0
        showMessage = 1
        message = *
        error = Das Feld ist erforderlich.
        element = Vorname
    }
    4 = email
    4 {
        breakOnError = 0
        showMessage = 1
        message = *
        error = Dies ist keine gültige E-Mail-Adresse.
        element = E-Mail
    }
    5 = required
    5 {
        breakOnError = 0
        showMessage = 1
        message = *
        error = Das Feld ist erforderlich.
        element = Datenschutz
    }
}

When I try to send the form I get a blank page only showing this php error:

Fatal error: Call to a member function getValue() on a non-object in /html/typo3/typo3_src-4.6.0/typo3/sysext/form/Classes/Domain/Model/Attributes/Attributes.php on line 154

The error stays after that. I cannot access the form anymore. When I try to load the page which contains the form (just form without the submit) I get the exact same error.

When I switch to

confirmation = 0

I get a different error (this time the utput comes from Typo, not php) upon accessing the page with the form:
Oops, an error occurred!

Address set in PathHeader does not comply with addr-spec of RFC 2822.

Can anyone reproduce the error or give advise?

Best regards


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #35384: Fatal error: Call to a member function getValue() [Attributes.php line 154]Closed2011-11-07

Actions
Is duplicate of TYPO3 Core - Bug #31778: Fatal error: Call to a member function getValue() on a non-objectRejected2011-11-12

Actions
Actions #1

Updated by Jan Schreier about 13 years ago

Hi Benjamin,

I think if you replace the
name = Straße
with
name = Strasse
it works fine. At least it worked for me :) So there seems an issue with handling of special chars in names.

Actions #2

Updated by Benni Mack about 13 years ago

  • Status changed from New to Accepted
Actions #3

Updated by Thorsten Kahler almost 13 years ago

  • Status changed from Accepted to Rejected

I can't reproduce the bug either.

Actions #4

Updated by Benjamin bunse over 12 years ago

I could solve my problem.

We use Mittwald CM hosting and there is a problem with the default settings in the localconf.php. To resolve it set the following in the install tool:
$TYPO3_CONF_VARS['SYS']['forceReturnPath'] = '0'

Thanks for the help!

Actions #5

Updated by Stefan Neufeind about 12 years ago

Experienced this problem as well on a site. Setting forceReturnPath to zero, as you wrote, did not help unfortunately. Only setting "confirmation = 0" (not using a confirmation-page) helped. This was tested with 4.6.13.

Actions #6

Updated by Hendrik about 12 years ago

This is still happening for umlauts and special characters in the name attribute. In 4.7.4. this can be fixed by removing the characters from your form config as shown in comment #1 by Jan.

However, you might get the error even after you have changed all the names. You have to close down your browser and open the page back up for the changes to take effect. The session holds your previous entries in the form and will reload them without checking the configuration changes first. Also, the session can not be cleared by clearing the Typo3 cache.

Actions #7

Updated by Jonas Götze almost 12 years ago

I think this or one of its related issues should be reopened.

I get this Error in a Form with TYPO3 CMS 4.7.7 while having fields with special Chars (german umlauts) or even whitespaces.
At least the error could be chatched and handled properly in tx_form_Domain_Model_Attributes_Attributes on line 154 or better it could be checked in the Backend wizard already and produce a warning.
An Editor will destroy the form most times he edits it (at least in germany).

After removing every whitespace and special char the form submits fine.
I actually cannot believe that this is not reproducable...

@Hendrik: All you need to do to show the form after the error occured is deleting the cookie fe_typo_user.

Regards

Actions #8

Updated by Simon Schaufelberger over 11 years ago

i also get the error for "Straße" (found that out with xdebug)

Actions #9

Updated by stefan schreck over 11 years ago

I get the same error with the FORM extension called.
but I can't really narrow done the problem.
I happens when a fe_user is logged in and only for some.
in that example the fe_user has "Umlauts" in her name but that is not the cause.
ANY HINTS?
thx.

Actions #10

Updated by stefan schreck over 11 years ago

GOT IT: Easy to reproduce.
It happens if there is a SPACE in the "name = " value!

Actions #11

Updated by Chris topher over 11 years ago

Copying over Ernesto's idea from 35384:

Easierst would be to sanitize the field name to something that is valid in the context where it is being used (for example in HTML it must be a valid form name/id). Maybe simply converting to ASCII ($cs->specCharsToASCII()) and replacing spaces with "_" could be enough.

Actions #12

Updated by Chris topher over 11 years ago

  • Status changed from Rejected to Accepted
Actions #13

Updated by Bernd Wilke almost 11 years ago

still (4.7.17) non alphanumeric characters break the website:
an editor inserted a colon after the fieldname which resulted in an empty page after the submit (PHP-error)

Actions #14

Updated by Wolfgang Klinger over 10 years ago

Still a problem with TYPO3 6.2 :-(

Actions #15

Updated by Florian Seirer over 10 years ago

Same here on 6.2.
No special characters or spaces used.
It only works if I set confirmation = 0, but not with confirmation = 1.

Actions #16

Updated by Georg Kühnberger about 10 years ago

Confirmed and still a problem in 6.2.4.

Actions #17

Updated by Mathias Schreiber almost 10 years ago

  • Status changed from Accepted to Closed
  • Is Regression set to No

dupe, we will continue in #35384

Actions

Also available in: Atom PDF