Bonjour,
Nouvel adepte de Symfony, j'ai commencén comme tout bon élève, par
travailler sur le projet exemple "Blog, à ceci près que j'ai voulu utiliser
directement une base SQL Serveur.
Tout etait Ok jusqu'à présent, mais je tombe sur un problème lors de
l'utilisation de la pagination en testant la page /blog/2.
Sous Symfony 2.0.17 on obtient :
Notice: Undefined index: doctrine_rownum in
C:\Developpement\Apache\htdocs\Symfony20\vendor\doctrine\lib\Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator.php
line 79
Sous Symfony 2.1.0 RC2 on obtient :
Notice: Undefined index: doctrine_rownum in
C:\Developpement\Apache\htdocs\Symfony21\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator.php
line 184
Jai pu contourner le problème en corrigeant le code source, mais peut-être
n'est-ce pas la correction adéquate :
Sous Symfony 2.0.17 j'ai corrigé ainsi : (en rouge les parties ajoutées)
protected function _hydrateRow(array $sqlResult, array &$cache, array
&$result)
{
$data = array();
if ($this->class->inheritanceType ==
ClassMetadata::INHERITANCE_TYPE_NONE) {
foreach ($sqlResult as $column => $value) {
if (!isset($cache[$column])) {
if (isset($this->_rsm->fieldMappings[$column])) {
$cache[$column]['name'] =
$this->_rsm->fieldMappings[$column];
$cache[$column]['field'] = true;
} else if (isset($this->_rsm->metaMappings[$column])){
$cache[$column]['name'] =
$this->_rsm->metaMappings[$column];
} else {
$cache[$column]['name'] = $column;
}
}
.../...
Sous Symfony 2.1.0 RC2 j'ai corrigé ainsi : (en rouge les parties ajoutées)
protected function hydrateColumnInfo($entityName, $column)
{
switch (true) {
case (isset($this->_rsm->fieldMappings[$column])):
$class = isset($this->declaringClasses[$column])
? $this->declaringClasses[$column]
: $this->class;
// If class is not part of the inheritance, ignore
if ( ! ($class->name === $entityName ||
is_subclass_of($entityName, $class->name))) {
return null;
}
return array(
'class' => $class,
'name' => $this->_rsm->fieldMappings[$column],
'field' => true,
);
case (isset($this->_rsm->relationMap[$column])):
$class = isset($this->_rsm->relationMap[$column])
? $this->_rsm->relationMap[$column]
: $this->class;
// If class is not self referencing, ignore
if ( ! ($class === $entityName ||
is_subclass_of($entityName, $class))) {
return null;
}
// TODO: Decide what to do with associations. It seems
original code is incomplete.
// One solution is to load the association, but it might
require extra efforts.
return array('name' => $column);
case (isset($this->_rsm->metaMappings[$column])):
return array(
'name' => $this->_rsm->metaMappings[$column]
);
default:
return null;
}
}
}
J'espère avoir été assez clair.
En attendant la correction définitive.
Et bravo pour ce super produit !
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en