Hi,
I had the same problem, but not with the admingenerator.
I set a new widgetschema in my formclass, to overwrite the widgetschema in the generated baseclass.
In the docs it says that the configure method is used in the users formclass, so you don't have to rewrite the whole setup routine of the generated baseclass.
Unfortunately, when you call setWidgets, a new (empty) widgetSchema is created; so this also overwrites the nameformat.
My mistake was that I didn't explicitly set the nameformat for the widgetschema in the configure method again, as well as the errorSchema. Just had to copy them from the baseclass.
However, Symfony shouldn't raise this error. I looked a bit into the code and found, that the default value for a new widgetSchemas nameFormat is '%s'. The getName method of the form checks for '%s' and returns false for the name, but the value of getName is just passed on to the getParameter methods and this produces the array error. False is no valid array index

~

~
The getParameter method looks like this:
- Code: Select all
public function getParameter($name, $default = null)
{
return $this->parameterHolder->get($name, $default);
}
and parameterHolder->get looks like:
- Code: Select all
public function & get($name, $default = null)
{
if (array_key_exists($name, $this->parameters))
{
$value = & $this->parameters[$name];
}
else
{
$value = sfToolkit::getArrayValueForPath($this->parameters, $name, $default);
}
return $value;
}
It crashes, because array_key_exists itself can't handle 'false' as $name. So either build a check for this and give the poor symfony hacker a proper error message, so he doesn't have to read through the whole sourcetree

~

~

; or leave it that way.
Sounds dumb, but I think this method is really trimmed for performance. Request Parameters are frequently accessed and that shouldn't take too long.
Please give me feedback. Shall I file a bug report for this? Or just keep this in the forums, so other devs know what's wrong, when they get this error.