Indeed, you are right. Was too confused to read it properly. Can we do the validation in there then, should be more visible where the problem is coming from.

----- Reply message -----
Von: "Shane Archer" <notifications@github.com>
An: "doctrine/phpcr-odm" <phpcr-odm@noreply.github.com>
Cc: "David Buchmann" <david@liip.ch>
Betreff: [phpcr-odm] Make sure that node names do not contain illegal characters (#432)
Datum: Mi., Mär. 12, 2014 19:41
In lib/Doctrine/ODM/PHPCR/UnitOfWork.php: 
> @@ -1393,6 +1398,11 @@ private function computeChildChanges($mapping, $child, $parentId, $nodename, $pa 
>                          ); 
>                      } 
>                  } 
> + 
> +                if ($exception = $targetClass->isValidNodename($nodename)) { 

We do get there unfortunately. In getChildNodename there is a branch of logic around whether or not a mapped nodename exists, and since we do have a mapped nodename in this case, it bypasses the ID generator entirely and just returns the name. 

Code is: 

$childClass = $this->dm->getClassMetadata(get_class($child)); 
if ($childClass->nodename && $childClass->reflFields[$childClass->nodename]->getValue($child)) { 
$nodename = $childClass->reflFields[$childClass->nodename]->getValue($child); 
} else { 
... 
} 

return $nodename; 


&mdash;
Reply to this email directly or view it on GitHub.