Changeset 17654

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

script to test create and update for each object class and some fixes based on results, *tons* of stuff to be fixed still

Files:

Legend:

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

    r17647 r17654  
    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"; 
  • branches/MidCOM_2_8/net.nemein.favourites/favourite.php

    r16449 r17654  
    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 
     
    7882        } 
    7983        $qb = net_nemein_favourites_favourite_dba::new_query_builder(); 
    80         $qb->add_constraint('objectGuid', '=', $this->objectGuid); 
     84        $qb->add_constraint('objectGuid', '=', (string)$this->objectGuid); 
    8185         
    8286        if ($this->bury) 
  • branches/MidCOM_2_8/net.nemein.registrations/registration.php

    r17004 r17654  
    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}"; 
  • branches/MidCOM_2_8/org.openpsa.projects/resource_midcomdba.php

    r4794 r17654  
    4343        $qb = org_openpsa_contacts_buddy::new_query_builder(); 
    4444        $user = $_MIDCOM->auth->user->get_storage(); 
    45         $qb->add_constraint('account', '=', $account->guid); 
    46         $qb->add_constraint('buddy', '=', $this->_personobject->guid); 
     45        $qb->add_constraint('account', '=', (string)$account->guid); 
     46        $qb->add_constraint('buddy', '=', (string)$this->_personobject->guid); 
    4747        $qb->add_constraint('blacklisted', '=', false); 
    4848        $buddies = $qb->execute(); 
     
    6262    { 
    6363        $qb = org_openpsa_projects_task_resource::new_query_builder(); 
    64         $qb->add_constraint('person', '=', $this->person); 
    65         $qb->add_constraint('task', '=', $this->task); 
    66         $qb->add_constraint('orgOpenpsaObtype', '=', $this->orgOpenpsaObtype); 
     64        $qb->add_constraint('person', '=', (int)$this->person); 
     65        $qb->add_constraint('task', '=', (int)$this->task); 
     66        $qb->add_constraint('orgOpenpsaObtype', '=', (int)$this->orgOpenpsaObtype); 
    6767 
    6868        if ($this->id) 
    6969        { 
    70             $qb->add_constraint('id', '<>', $this->id); 
     70            $qb->add_constraint('id', '<>', (int)$this->id); 
    7171        } 
    7272 
     
    104104            // Add resource to other resources' buddy lists 
    105105            $qb = org_openpsa_projects_task_resource::new_query_builder(); 
    106             $qb->add_constraint('task', '=', $this->task); 
     106            $qb->add_constraint('task', '=', (int)$this->task); 
    107107            $qb->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_PROJECTRESOURCE); 
    108             $qb->add_constraint('id', '<>', $this->id); 
     108            $qb->add_constraint('id', '<>', (int)$this->id); 
    109109            $resources = $qb->execute(); 
    110110            foreach ($resources as $resource) 
  • branches/MidCOM_2_8/org.openpsa.sales/salesproject_member.php

    r4794 r17654  
    3838        $qb = org_openpsa_contacts_buddy::new_query_builder(); 
    3939        $user =& $_MIDCOM->auth->user->get_storage(); 
    40         $qb->add_constraint('account', '=', $owner->guid); 
    41         $qb->add_constraint('buddy', '=', $person->guid); 
     40        $qb->add_constraint('account', '=', (string)$owner->guid); 
     41        $qb->add_constraint('buddy', '=', (string)$person->guid); 
    4242        $qb->add_constraint('blacklisted', '=', false); 
    4343        $buddies = $qb->execute(); 
  • branches/MidCOM_2_8/org.routamc.positioning/aerodrome.php

    r14980 r17654  
    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(); 
  • branches/MidCOM_2_8/org.routamc.positioning/country.php

    r14980 r17654  
    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        } 
  • branches/MidCOM_2_8/org.routamc.positioning/log.php

    r12901 r17654  
    6969                    MIDCOM_LOG_WARN); 
    7070            debug_pop(); 
     71            mgd_set_errno(MGD_ERR_DUPLICATE); 
    7172            return false; 
    7273        } 
     
    8283    { 
    8384        $qb = org_routamc_positioning_log_dba::new_query_builder(); 
    84         $qb->add_constraint('person', '=', $this->person); 
    85         $qb->add_constraint('date', '<=', $this->date); 
     85        $qb->add_constraint('person', '=', (int)$this->person); 
     86        $qb->add_constraint('date', '<=', (int)$this->date); 
    8687        $qb->add_order('date', 'DESC'); 
    8788        $qb->set_limit(1); 
     
    102103    { 
    103104        $qb = org_routamc_positioning_log_dba::new_query_builder(); 
    104         $qb->add_constraint('person', '=', $this->person); 
    105         $qb->add_constraint('date', '>', $this->date); 
     105        $qb->add_constraint('person', '=', (int)$this->person); 
     106        $qb->add_constraint('date', '>', (int)$this->date); 
    106107        $qb->add_order('date', 'ASC'); 
    107108        $qb->set_limit(1);