Revision: 1404
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1404&view=rev
Author:   cimorrison
Date:     2010-08-06 09:32:39 +0000 (Fri, 06 Aug 2010)

Log Message:
-----------
Extended edit_area_room.php so that it can cope with non-nullable custom fields 
properly

Modified Paths:
--------------
    mrbs/trunk/web/edit_area_room.php

Modified: mrbs/trunk/web/edit_area_room.php
===================================================================
--- mrbs/trunk/web/edit_area_room.php   2010-08-06 08:53:54 UTC (rev 1403)
+++ mrbs/trunk/web/edit_area_room.php   2010-08-06 09:32:39 UTC (rev 1404)
@@ -226,9 +226,12 @@
                 switch ($field['nature'])
                 {
                   case 'integer':
-                    if (!isset($$var))
+                    if (!isset($$var) || ($$var === ''))
                     {
-                      $$var = 'NULL';
+                      // Try and set it to NULL when we can because there will 
be cases when we
+                      // want to distinguish between NULL and 0 - especially 
when the field
+                      // is a genuine integer.
+                      $$var = ($field['is_nullable']) ? 'NULL' : 0;
                     }
                     break;
                   default:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to