⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Complex render loses column's data



kaosweaver
  • profile picture
  • Member

Posted 28 November 2012 - 19:39 PM

I've got a fairly complex setup:


$crud->where('Publish >','2012-08-01');
$crud->set_table('news')
->set_subject('Articles')
->columns('Title','Author','Publish','x')
->fields('Title','Author','Author2','Publish','Publish_end','Premium','Disable_premium_preview','Contains_Video','Enable_comment_threads','show_on_mobile','Leadin','Raw_HTML','Body','Mobile_body','Enable_body_transformation','facebook_URL','twitter_text','twitter_posted','Type','x')
->display_as('Title','Article Title')
->display_as('Author','Author')
->display_as('Publish','Publish Date')
->display_as('Author2','Second Author')
->display_as('Publish_end','Publish End')
->display_as('Contains_Video','Has Video');
$crud->set_relation('Author','bio','Author');
$crud->set_relation('Author2','bio','Author');
$crud->field_type('Enable_body_transformation','true_false');
$crud->field_type('Contains_Video','true_false');
$crud->field_type('Enable_comment_threads','true_false');
$crud->field_type('Disable_premium_preview','true_false');
$crud->field_type('Premium','true_false');
$crud->field_type('twitter_posted','true_false');
$crud->field_type('facebook_URL','readonly');
$crud->field_type('Type','hidden','strategy');
$crud->set_relation_n_n('x','news_to_tags','news_tags','article_ID','tag_ID','tag_name')
->display_as("x","Tags");
$crud->unset_texteditor('Leadin','Raw_HTML','Body','Mobile_body');
$crud->order_by('Publish','desc');
$crud->callback_after_insert(array($this, 'clear_cache'));
$crud->callback_after_update(array($this, 'clear_cache'));
$crud->callback_field('Raw_HTML',array($this,'field_callback_0'));
$crud->callback_field('Body',array($this,'field_callback_1'));
$crud->callback_field('twitter_text',array($this,'field_callback_2'));
$crud->callback_before_insert(array($this,'before_actions'));
$crud->callback_before_update(array($this,'before_actions'));
$data['output'] = $crud->render();


The add/edit/delete works (as desired) however, on the landing page where we're supposed to have the four columns, the Author's column is missing. As you can see, we have two columns related to the Bio table (Author and Author2) as well as a NxN relation between this table and the tags for the article.

I'm not sure on what I need to do to get the Author's column to show up, anyone have any ideas (and do excuse the code, it was added on to repeatedly and not cleaned up)