------------------------------------------------------------
revno: 1200
committer: rejon <rejon@F2Gallery>
branch nick: public
timestamp: Sat 2012-05-12 09:51:29 +0000
message:
  added a fix in Records.php and tested on our fabienfryns.com test site to make
  sure it works on forms. Overall, Records.php just like Forms.php are 
minefields
  of problems, so its starting to become a pile of dirty bandaids
modified:
  libs/Records.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/Records.php'
--- libs/Records.php	2012-05-09 19:23:44 +0000
+++ libs/Records.php	2012-05-12 09:51:29 +0000
@@ -997,6 +997,7 @@
 	public function edit_db_record_by_form_post($post, $form_id, $record_id) {
 		global $db, $aiki, $membership, $config;
 
+        $found_a_value = false;
 		if (!$post) {
 			return '';
 		} else {
@@ -1014,8 +1015,7 @@
 				}
 			}
 		}
-
-		if (!isset($found_a_value)) {
+		if (!($found_a_value)) {
 			return '';
 		}
 		if (!isset($post['form_post_type'])) {
@@ -1026,6 +1026,10 @@
 		$form = $db->get_row("SELECT * from aiki_forms where ".
 							 "id='$form_id' limit 1");
 
+        // NOTE: This might have side effects, but is causing errors
+        // so need to return here and nip the problem in the bud.
+        if ( !(isset($form->form_array)))
+            return '';
 		$form_array = unserialize($form->form_array);
 
 		$arraykeys = array_keys($form_array);

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : aikiframework-devel@lists.launchpad.net
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to