Project

General

Profile

Actions

Bug #35384

closed

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

Added by Daniel Gercke about 12 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Should 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 duplicated this bug report, because i could not reopen it.
The Problem seems only to occur if you use for example "straße" instead of "strasse" as a form field.
This should be catched!

-----------------
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 #31652: Fatal error: Call to a member function getValue() [Attributes.php line 154]Closed2011-11-07

Actions
Is duplicate of TYPO3 Core - Bug #36950: new form content element: input of OPTIONS >> ATTRIBUTES PROPERTIES >> NAME for a specific form element should be validatedClosed2012-05-08

Actions
Actions #1

Updated by Andreas Wolf about 12 years ago

You should not use special characters in field names; apart from that, it is of course a bug that this is not validated when creating the form in the wizard or caught when creating the form object (with a clear error message).

Actions #2

Updated by Daniel Gercke about 12 years ago

You know that you and I know that, but we can not assume that everybody knows. ;-)

Actions #3

Updated by Andreas Wolf about 12 years ago

  • Status changed from New to Accepted

Daniel Gercke wrote:

You know that you and I know that, but we can not assume that everybody knows. ;-)

You're of course right :-) - that's why I said we should not let this pass. Do you think you could dig into that and provide a patch were appropriate? I think we might (should) even log something when forms with problematic names are rendered, as people could also directly input TypoScript that contains invalid element names.

Actions #4

Updated by Mario Rimann almost 12 years ago

I just ran into this error, too (on a TYPO3 v4.7.2 based installation). In our case it was a field that was named "PLZ / Ort". As soon as this was changed to "Ort" as a fieldname while keeping "PLZ / Ort" as the label text, it worked out fine.

Actions #5

Updated by Ernesto Baschny almost 12 years ago

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 #6

Updated by Mathias Schreiber over 9 years ago

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

duplicate of #36950, will continue there

Actions #7

Updated by Björn Jacob almost 9 years ago

  • Category changed from Form Framework to 1602
Actions #8

Updated by Björn Jacob about 8 years ago

  • Category changed from 1602 to Form Framework
Actions

Also available in: Atom PDF