Skip to content
Snippets Groups Projects
Commit 731d99b4 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #15865 fix recursivity

parent 0926b18a
Branches
Tags
3 merge requests!393Master,!392Hotline 6.51,!379Hotline 15865 wrong libelle codif auteur
......@@ -44,15 +44,13 @@ class CodifAuteurLoader extends Storm_Model_Loader {
public function repairAllWithWrongLibelle() {
$auteurs = Class_CodifAuteur::findAllBy(['where' => 'BINARY libelle = formes and libelle like \'%x%\'',
$request='BINARY libelle = formes and BINARY libelle like \'%x%\'';
$auteurs = Class_CodifAuteur::findAllBy(['where' => $request,
'limit' => 5000
]);
$auteurs_to_repair= [];
foreach($auteurs as $auteur) {
if($auteur->getLibelle() != $auteur->getFormes() )
continue;
if(($auteur->getLibelle() === 'x') && ($auteur->getFormes() === 'x')){
$auteur->delete();
......@@ -70,7 +68,7 @@ class CodifAuteurLoader extends Storm_Model_Loader {
if($new_auteur = $notice->getAuteurWith($auteur->getFormes()))
$auteur->setLibelle($new_auteur)->save();
}
if (Class_CodifAuteur::countBy(['where' => 'BINARY libelle = formes and libelle like \'%x%\''
if (Class_CodifAuteur::countBy(['where' => $request
])>0)
$this->repairAllWithWrongLibelle();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment