Changeset 17655

Show
Ignore:
Timestamp:
09/22/08 15:34:22 (2 months ago)
Author:
rambo
Message:

forward port r17654

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.reflector/exec/test.php

    r17648 r17655  
    2323    // this will exit 
    2424} 
    25 $reflector = new midcom_helper_reflector($object); 
     25$reflector =& midcom_helper_reflector::get($object); 
    2626 
    2727echo "Got " . $reflector->get_class_label() . ' "' . $reflector->get_object_label($object) . "\", dump<pre>\n"; 
  • trunk/midcom/net.nemein.favourites/favourite.php

    r16448 r17655  
    3333    function get_parent_guid_uncached() 
    3434    { 
    35         return $this->metadata->creator; 
     35        if (   isset($this->metadata) 
     36            && isset($this->metadata->creator)) 
     37        { 
     38            return $this->metadata->creator; 
     39        } 
    3640    } 
    3741     
     
    8791        } 
    8892        $qb = net_nemein_favourites_favourite_dba::new_query_builder(); 
    89         $qb->add_constraint('objectGuid', '=', $this->objectGuid); 
     93        $qb->add_constraint('objectGuid', '=', (string)$this->objectGuid); 
    9094         
    9195        if ($this->bury) 
  • trunk/midcom/net.nemein.registrations/registration.php

    r17003 r17655  
    128128    function _run_pricing_plugin() 
    129129    { 
     130        if (   !isset($this->_config) 
     131            || !is_object($this->_config)) 
     132        { 
     133            // Could not read config 
     134            return false; 
     135        } 
    130136        // The plugin is likely to update us (perhaps many times if it sets parameters...), thus causing loops unless we take care 
    131137        $flag = "net_nemein_registrations_registration_dba__run_pricing_plugin_{$this->guid}"; 
  • trunk/midcom/org.openpsa.projects/resource.php

    r17595 r17655  
    5151        $qb = org_openpsa_contacts_buddy::new_query_builder(); 
    5252        $user = $_MIDCOM->auth->user->get_storage(); 
    53         $qb->add_constraint('account', '=', $account->guid); 
    54         $qb->add_constraint('buddy', '=', $this->_personobject->guid); 
     53        $qb->add_constraint('account', '=', (string)$account->guid); 
     54        $qb->add_constraint('buddy', '=', (string)$this->_personobject->guid); 
    5555        $qb->add_constraint('blacklisted', '=', false); 
    5656        $buddies = $qb->execute(); 
     
    7070    { 
    7171        $qb = org_openpsa_projects_task_resource::new_query_builder(); 
    72         $qb->add_constraint('person', '=', $this->person); 
    73         $qb->add_constraint('task', '=', $this->task); 
    74         $qb->add_constraint('orgOpenpsaObtype', '=', $this->orgOpenpsaObtype); 
     72        $qb->add_constraint('person', '=', (int)$this->person); 
     73        $qb->add_constraint('task', '=', (int)$this->task); 
     74        $qb->add_constraint('orgOpenpsaObtype', '=', (int)$this->orgOpenpsaObtype); 
    7575 
    7676        if ($this->id) 
    7777        { 
    78             $qb->add_constraint('id', '<>', $this->id); 
     78            $qb->add_constraint('id', '<>', (int)$this->id); 
    7979        } 
    8080 
     
    112112            // Add resource to other resources' buddy lists 
    113113            $qb = org_openpsa_projects_task_resource::new_query_builder(); 
    114             $qb->add_constraint('task', '=', $this->task); 
     114            $qb->add_constraint('task', '=', (int)$this->task); 
    115115            $qb->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_PROJECTRESOURCE); 
    116             $qb->add_constraint('id', '<>', $this->id); 
     116            $qb->add_constraint('id', '<>', (int)$this->id); 
    117117            $resources = $qb->execute(); 
    118118            foreach ($resources as $resource) 
     
    148148 
    149149        $qb = org_openpsa_projects_task_resource::new_query_builder(); 
    150         $qb->add_constraint('person', '=', $_MIDGARD['user']); 
     150        $qb->add_constraint('person', '=', (int)$_MIDGARD['user']); 
    151151        $qb->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_PROJECTRESOURCE); 
    152152        $qb->add_constraint('task.orgOpenpsaObtype', '<>', ORG_OPENPSA_OBTYPE_PROJECT); 
  • trunk/midcom/org.openpsa.sales/salesproject/member.php

    r17297 r17655  
    5252        $qb = org_openpsa_contacts_buddy::new_query_builder(); 
    5353        $user =& $_MIDCOM->auth->user->get_storage(); 
    54         $qb->add_constraint('account', '=', $owner->guid); 
    55         $qb->add_constraint('buddy', '=', $person->guid); 
     54        $qb->add_constraint('account', '=', (string)$owner->guid); 
     55        $qb->add_constraint('buddy', '=', (string)$person->guid); 
    5656        $qb->add_constraint('blacklisted', '=', false); 
    5757        $buddies = $qb->execute(); 
  • trunk/midcom/org.routamc.positioning/aerodrome.php

    r14613 r17655  
    7474        } 
    7575 
    76         $qb = org_routamc_positioning_aerodrome_dba::new_query_builder(); 
    77         $qb->add_constraint('icao', '=', $this->icao); 
    78         $qb->set_limit(1); 
    79         $matches = $qb->execute_unchecked(); 
    80         if (count($matches) > 0) 
     76        if (!empty($this->icao)) 
    8177        { 
    82             // We don't need to save duplicate entries 
    83             return false; 
     78            $qb = org_routamc_positioning_aerodrome_dba::new_query_builder(); 
     79            $qb->add_constraint('icao', '=', $this->icao); 
     80            $qb->set_limit(1); 
     81            $matches = $qb->execute_unchecked(); 
     82            if (count($matches) > 0) 
     83            { 
     84                // We don't need to save duplicate entries 
     85                mgd_set_errno(MGD_ERR_DUPLICATE); 
     86                return false; 
     87            } 
    8488        } 
    8589        return parent::_on_creating(); 
  • trunk/midcom/org.routamc.positioning/country.php

    r14622 r17655  
    3434    { 
    3535        $qb = org_routamc_positioning_country_dba::new_query_builder(); 
    36         $qb->add_constraint('name', '=', $this->name); 
     36        $qb->add_constraint('name', '=', (string)$this->name); 
    3737        $qb->set_limit(1); 
    3838        $matches = $qb->execute_unchecked(); 
     
    4040        { 
    4141            // We don't need to save duplicate entries 
     42            mgd_set_errno(MGD_ERR_DUPLICATE); 
    4243            return false; 
    4344        } 
  • trunk/midcom/org.routamc.positioning/log.php

    r17141 r17655  
    7070                    MIDCOM_LOG_WARN); 
    7171            debug_pop(); 
     72            mgd_set_errno(MGD_ERR_DUPLICATE); 
    7273            return false; 
    7374        } 
     
    8788        } 
    8889        $qb = org_routamc_positioning_log_dba::new_query_builder(); 
    89         $qb->add_constraint('person', '=', $this->person); 
    90         $qb->add_constraint('date', '<=', $this->date); 
     90        $qb->add_constraint('person', '=', (int)$this->person); 
     91        $qb->add_constraint('date', '<=', (int)$this->date); 
    9192        $qb->add_order('date', 'DESC'); 
    9293        $qb->set_limit(1); 
     
    111112        } 
    112113        $qb = org_routamc_positioning_log_dba::new_query_builder(); 
    113         $qb->add_constraint('person', '=', $this->person); 
    114         $qb->add_constraint('date', '>', $this->date); 
     114        $qb->add_constraint('person', '=', (int)$this->person); 
     115        $qb->add_constraint('date', '>', (int)$this->date); 
    115116        $qb->add_order('date', 'ASC'); 
    116117        $qb->set_limit(1);