Table editor fills the new entry form with the default values of the fields
[platal.git] / modules / banana / banana.inc.php
index af6a063..1442220 100644 (file)
@@ -59,7 +59,7 @@ function hook_browsingAction()
 function hook_makeLink($params) {
     global $globals;
     $base = $globals->baseurl . '/banana';
-    if ($params['subscribe'] == 1) {
+    if (@$params['subscribe'] == 1) {
         return $base . '/subscription';
     }
     if (isset($params['xface'])) {
@@ -75,9 +75,9 @@ function hook_makeLink($params) {
         return $base . '/from/' . $params['first'];
     }
     if (isset($params['artid'])) {
-        if ($params['action'] == 'new') {
+        if (@$params['action'] == 'new') {
             $base .= '/reply';
-        } elseif ($params['action'] == 'cancel') {
+        } elseif (@$params['action'] == 'cancel') {
             $base .= '/cancel';
         } else {
             $base .= '/read';
@@ -85,7 +85,7 @@ function hook_makeLink($params) {
         return $base . '/' . $params['artid'];
     }
 
-    if ($params['action'] == 'new') {
+    if (@$params['action'] == 'new') {
         return $base . '/new';
     }
     return $base;
@@ -207,7 +207,7 @@ class PlatalBanana extends Banana
         $diff = array_diff($_POST['subscribe'], array_keys($fids));
         foreach ($diff as $g) {
             XDB::execute("INSERT INTO {$globals->banana->table_prefix}list (nom) VALUES ({?})", $g);
-            $fids[$g] = mysql_insert_id();
+            $fids[$g] = XDB::insertId();
         }
 
         foreach ($_POST['subscribe'] as $g) {