Re: DB_DataObject_FormBuilder and crossLinkExtraFields

From: Date: Sat, 30 Sep 2006 21:33:21 +0000
Subject: Re: DB_DataObject_FormBuilder and crossLinkExtraFields
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-44216@lists.php.net to get a copy of this message
Picking up on this again as I didn't have time during the week. On Sep 23, 2006, at 8:00 PM, Justin Patrin wrote:
On 9/23/06, James Stewart <lists@jystewart.net> wrote:
On Sep 23, 2006, at 2:53 AM, Justin Patrin wrote:
On 9/22/06, James Stewart <lists@jystewart.net> wrote:
It was auto-generated, and the keys entry is as shown.
Well, line 3006 of FormBuilder.php calls processForm on a sub-FB instance for the crossLink-ed record so the normal FB algorithm is used for insert vs. update. Try creating a DO manually for a record in that table then
calling $pk
= DB_DataObject_FormBuilder::_getPrimaryKey($do) and seeing
what's in
$pk. If this shows the expected output ("id") then try manually creating an FB and setting it up to edit the record (note: pearified/DB_DataObject_FormBuilder_Frontend can be used to browse/edit all data in any DOs :-).
Creating a DO for just the conference_session_time_slot table and then calling print DB_DataObject_FormBuilder::_getPrimaryKey($do); returns 'id' as expected, and generating and using a form for just that table works too. It seems to be just when it's used as a crossLink/extraField that I run into problems.
Sorry, I'm not sure what it could be. Are you using the newest version of FormBuilder? If you are, I suggest going into the FormBuilder code and trying to figure out what happens. Try looking around line 2824 of FormBuilder.php and see what is in $this->_do, what $this->_queryType is set to, and what $action gets set to.
It looks like $action gets set to 0. It looks like it's not picking up an ID when it goes into processForm() for the cross linked fields. Entering processForm() $fields contains: array ( 'id' => '1', 'name' => 'Culture, Calling, &amp; Consequences', 'summary' => 'With Special Guests: Mark Rodgers &amp; Erik Lokkesmoe', 'type' => '2', 'url' => '', 'identifier' => 'culture-calling', 'conference' => 'jubilee2007', '__crossLink_conference_presenter_session_session_id_presenter_id' => array (
    1 => '1',
), '__crossLink_conference_session_time_slot_session_id_time_slot__1_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__2_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot' => array (
    3 => '3',
), '__crossLink_conference_session_time_slot_session_id_time_slot__3_location_' => '13', '__crossLink_conference_session_time_slot_session_id_time_slot__4_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__5_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__6_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__7_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__12_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__8_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__9_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__10_location_' => '', '__crossLink_conference_session_time_slot_session_id_time_slot__11_location_' => '', '__submit__' => 'Submit', ) _do contains: DataObjects_Conference_session_time_slot Object (
    [__table] => conference_session_time_slot
    [id] =>
    [session_id] =>
    [time_slot] =>
    [location] =>
    [fb_crossLinkExtraFields] => Array
        (
            [0] => location
        )
    [fb_linkNewValue] =>
    [_DB_DataObject_version] => 1.8.4
    [N] => 0
    [_database_dsn] =>
    [_database_dsn_md5] => 60d3c5efbeb452ee8c11cb916ae45d53
    [_database] => db176484393
    [_query] => Array
        (
            [condition] =>
            [group_by] =>
            [order_by] =>
            [having] =>
            [limit_start] =>
            [limit_count] =>
            [data_select] => *
        )
    [_DB_resultid] =>
    [_resultFields] =>
    [_link_loaded] =>
    [_join] =>
    [_lastError] =>
    [fb_fieldsToRender] => Array
        (
            [0] => location
        )
    [fb_elementNamePrefix] => __crossLink_conference_session_time_slot_session_id_time_slot__3_
    [fb_elementNamePostfix] => _
) and the result of $this->_getMyValues($values) is: array ( 'location' => '13', ) I'll continue digging, but if anyone has any idea what could be happening that'd be great. thanks. James.

« previous php.pear.dev (#44216) next »