Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Missing Multi2 column + debug tips + modify dbObject by task (first screen)
Missing Multi2 column + debug tips + modify dbObject by task [message #3263] Sun, 30 December 2012 20:57 Go to next message
markcarranza is currently offline  markcarranza
Messages: 14
Registered: December 2012
Location: San Francisco, CA, USA
Junior Member
I'm using the Radicore data dictionary to document legacy data. I added a 'col_rename' column to dict_column, and a 'Rename Column' Multi2 task to edit documentation of all a table's columns on the same screen.

Screen structure file attached.

Problem: The 'is_required' column is blank: <td> </td>.
Behavior: If I force an error, for example, leaving 'description' blank and submit, the proper 'is_required' dropdown shows(!) and edits to this column save (when 'description' filled in) on submit, but then go back to blank.

I traced the code, but don't know the system well enough to see something wrong yet.

I found: $_SESSION['log_xml_document'] = true;
1) Link please: where are debug tips documented?
so:
<is_required required="y" control="dropdown" optionlist="is_required" nodisplay="y">**hidden**</is_required>


But a breakpoint in dict_column.class.inc _cm_checkColumnType line 98
if (isset($colspecs['is_required'])) {

doesn't get hit(?)

I searched for _cm_checkColumnType in RADICORE for PHP - Functions, Methods and Variables, and not finding it there, went back and found it in dict_column.class.inc
2) would it make sense to have a naming convention for private(?) class methods different from foundation '_cm_...' methods?

So now I see: _cm_post_getData
//...
// just comment out for now
//        $this->fieldspec['is_required']['nodisplay']        = 'y';
//...
        if (count($rowdata) == 1) {
            $rowdata[0] = $this->_cm_checkColumnType($rowdata[0]);
        } // if


3) Link please: where is it covered how best to modify dbObject behavior by task?

4) How best to do this? Can I edit $this->fieldspec in a screen.inc file? Suggestions welcome. Thanks!

[Updated on: Sun, 30 December 2012 21:05]

Report message to a moderator

Re: Missing Multi2 column + debug tips + modify dbObject by task [message #3264 is a reply to message #3263] Sun, 30 December 2012 21:02 Go to previous messageGo to next message
markcarranza is currently offline  markcarranza
Messages: 14
Registered: December 2012
Location: San Francisco, CA, USA
Junior Member
I can't seem to upload the file here, so:
<?php
$structure['xsl_file'] = 'std.list2.xsl';
$structure['tables']['outer'] = 'dict_table';

// identify the column specs - may use 'width' or 'class'
$structure['outer']['columns'][] = array('width' => '25%');
$structure['outer']['columns'][] = array('width' => '*');

// identify the field names and their screen labels
$structure['outer']['fields'][] = array('database_id' => 'Database Id');
$structure['outer']['fields'][] = array('table_id' => 'Table Id');
$structure['outer']['fields'][] = array('table_desc' => 'Table Description');
$structure['outer']['fields'][] = array('tbl_comment' => 'Comment');

$structure['tables']['inner'] = 'dict_column';

// identify the column specs - may use 'width' or 'class'
$structure['inner']['columns'][] = array('width' => 5);
$structure['inner']['columns'][] = array('width' => 10, 'align' => 'right');
$structure['inner']['columns'][] = array('width' => 10, 'nowrap' => 'nowrap');
$structure['inner']['columns'][] = array('width' => 20);
$structure['inner']['columns'][] = array('width' => 40);
$structure['inner']['columns'][] = array('width' => '*');
$structure['inner']['columns'][] = array('width' => 20);

// identify the field names and their screen labels
$structure['inner']['fields'][] = array('selectbox' => 'Select');
$structure['inner']['fields'][] = array('column_seq' => '#');
$structure['inner']['fields'][] = array('column_id' => 'Name');
$structure['inner']['fields'][] = array('col_rename' => 'Rename', 'size' => 20);
$structure['inner']['fields'][] = array('column_desc' => 'Description', 'size' => 40, 'nosort' => 'y');
$structure['inner']['fields'][] = array('col_comment' => 'Comment', 'cols' => 40, 'rows' => 2, 'nosort' => 'y');
$structure['inner']['fields'][] = array('is_required' => 'Is Required', 'nosort' => 'y');

// uncomment to get debug XML in /xsl directory
// $_SESSION['log_xml_document'] = true;
Re: Missing Multi2 column + debug tips + modify dbObject by task [message #3337 is a reply to message #3263] Thu, 17 January 2013 17:32 Go to previous message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
What sql did you use to add the new column?

Did you import then export the changed table definition to recreate the dict_column.dict.inc file?

You really should learn how to build and then modify your own tasks and screens before yoiu start amending any core components.

Answers:

1) See What debugging aids exist in this framework? You should also try using a proper interactive debugger instead of just putting breakpoints where you *think* the error might be.

2) I have no plans to rename any methods.

3) See How do you deal with task-specific behaviour?

4) You do not edit $this->fieldspec in the screen.inc file. Use the _cm_changeConfig() method instead.


Previous Topic: Changing screen names
Next Topic: Does Radicore allow orphaned children?
Goto Forum:
  


Current Time: Sun Nov 24 08:23:45 EST 2024

Total time taken to generate the page: 0.01065 seconds