Prevent PlTableEditor from erasing values which weren't displayed. core/1.1.4/maint
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 19 May 2011 18:50:24 +0000 (20:50 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 19 May 2011 18:50:24 +0000 (20:50 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/pltableeditor.php

index 208a92d..6cda175 100644 (file)
@@ -362,8 +362,12 @@ class PLTableEditor
                         $val = ip2long($val);
                     }
                 } elseif ($descr['display']) {
+                    // The field wasn't available in Post, but was displayed
                     $cancel = true;
                     $page->trigError("Il manque le champ ".$field);
+                } else {
+                    // The field wasn't in Post, but wasn't displayed: ignore it.
+                    continue;
                 }
                 $values[$field] = XDB::escape($val);
             }