[cc-commits] [CC SVN] r11161 - in cchost/trunk/cchost_lib: . ccextras

webmaster at creativecommons.org webmaster at creativecommons.org
Tue Nov 11 19:17:25 EST 2008


Author: fourstones
Date: 2008-11-12 00:17:24 +0000 (Wed, 12 Nov 2008)
New Revision: 11161

Modified:
   cchost/trunk/cchost_lib/cc-config.php
   cchost/trunk/cchost_lib/cc-defines-events.php
   cchost/trunk/cchost_lib/ccextras/cc-howididit.inc
Log:
bugfix: edit hidi was broken with empty values
added config_changed event

Modified: cchost/trunk/cchost_lib/cc-config.php
===================================================================
--- cchost/trunk/cchost_lib/cc-config.php	2008-11-12 00:11:55 UTC (rev 11160)
+++ cchost/trunk/cchost_lib/cc-config.php	2008-11-12 00:17:24 UTC (rev 11161)
@@ -171,6 +171,7 @@
         $where['config_scope'] = $scope;
         $key = $this->QueryKey($where);
         $original = $arr;
+        $old = '';
         $where['config_data'] = serialize($arr);
         if( $key )
         {
@@ -199,6 +200,8 @@
         {
             $cache[$where['config_scope']][$where['config_type']] = $original;
         }
+
+        CCEvents::Invoke( CC_EVENT_CONFIG_CHAGNED, array( &$where, &$old ) );
         
         // yea, should be smarter about this, but alas... we're not
         require_once('cchost_lib/cc-template.php');

Modified: cchost/trunk/cchost_lib/cc-defines-events.php
===================================================================
--- cchost/trunk/cchost_lib/cc-defines-events.php	2008-11-12 00:11:55 UTC (rev 11160)
+++ cchost/trunk/cchost_lib/cc-defines-events.php	2008-11-12 00:17:24 UTC (rev 11161)
@@ -402,6 +402,8 @@
 */
 define('CC_EVENT_GET_CONFIG_FIELDS',   'getcfgflds' );
 
+define('CC_EVENT_CONFIG_CHAGNED', 'cfgchanged');
+
 /**
 * Notification Event: Upload is about to be deleted
 *

Modified: cchost/trunk/cchost_lib/ccextras/cc-howididit.inc
===================================================================
--- cchost/trunk/cchost_lib/ccextras/cc-howididit.inc	2008-11-12 00:11:55 UTC (rev 11160)
+++ cchost/trunk/cchost_lib/ccextras/cc-howididit.inc	2008-11-12 00:17:24 UTC (rev 11161)
@@ -163,7 +163,7 @@
                 CCUploadAPI::UpdateCCUD($upload_id,'','how_i_did_it');
 
                 $user_name = CCDatabase::QueryItem(
-                                'SELECT user_name FROM cc_tlb_uploads JOIN cc_tbl_user ON upload_user=user_id WHERE upload_id='.$upload_id);
+                                'SELECT user_name FROM cc_tbl_uploads JOIN cc_tbl_user ON upload_user=user_id WHERE upload_id='.$upload_id);
                 $url = ccl('files',$user_name,$upload_id);
                 CCPage::Prompt('str_hidi_no_rec',"<a href=\"$url\">","</a>");
             }




More information about the cc-commits mailing list