⚠ 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

Update of page causes infinite hang.



Adamantus

Adamantus
  • profile picture
  • Member

Posted 30 January 2013 - 14:45 PM

For some reason my pages are coming back with this error in the error console when I try to save. Pages hardly ever save properly and just grind away forever.

Timestamp: 30/01/2013 14:37:35
Error: TypeError: doc.defaultView is null
Source File: chrome://browserrecord/content/browserrecordloader.js
Line: 645


Here is my controller method for this section:


function pages()
{
$crud = new grocery_CRUD();

$crud->set_table( $this->router->method )
->set_subject( 'page' )
->columns('name','uri_name','description','date_post','author','row_num','sub_links','url','tags','slider') //Columns on display.
->display_as('uri_name','Name to match against')
->display_as('description','Description')
->display_as('tags','Search Keywords')
->display_as('row_num','Box Colour / Group')
->display_as('url','Complete url (for links)')
->display_as('slider','Add Slider?');

//Add / Edit methods.
$crud->fields('name','uri_name','url','description','date_post','author','row_num','sub_links','tags','slider'); //Fields to display for add / edit.

//Hidden auto-filled fields.
$crud->change_field_type('date_post', 'datetime', date('d-m-Y h:i:s',time()) );
$crud->change_field_type('author', 'hidden', $this->session->userdata('userId') );

$uri_name = isset($_POST['uri_name']) ? $_POST['uri_name'] : '';
$url = $this->options->company->groc_images_path.'/'.$uri_name;

//$crud->change_field_type('url', 'hidden', $url); //Process this using a callback to autofill below.
//Drop down menus. Selects some info from a database table and uses it to populate the drop down menu.
$crud->set_relation('sub_links', 'gc_bool', 'name');
$crud->set_relation('slider', 'gc_bool', 'name');
$crud->set_relation('row_num', 'gc_rows', 'name');
$crud->set_relation('author', 'users', 'userName');

$crud->required_fields('name','uri_name','description','date_post','author','row_num','sub_links'); //Required fields / form validation.

$output = $crud->render();//Set output variable for view.
$output->css_files[] = base_url().'css/grocery_crud.css';

//$this->_example_output($output);//Send to view.
$this->_example_output($output);
}

davidoster

davidoster
  • profile picture
  • Member

Posted 31 January 2013 - 00:18 AM

Can you explain this line a bit more?

[color=#000000] $output[/color][color=#666600]->[/color][color=#000000]css_files[/color][color=#666600][][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] base_url[/color][color=#666600]().[/color][color=#008800]'css/grocery_crud.css'[/color][color=#666600];[/color]

Adamantus

Adamantus
  • profile picture
  • Member

Posted 31 January 2013 - 10:38 AM

Hi David. I'm using a loop to print out the custom css / js files. Here is the code in the view:

<?php
foreach($css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
<?php foreach($js_files as $file): ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>


The base_url() just contains the path to the website and I've added the css location on to the end.

Adamantus

Adamantus
  • profile picture
  • Member

Posted 31 January 2013 - 13:26 PM

Actually in hindsight it seems to be working fine at work (same browser version). I think it must be something to do with addons I have installed at home. Although that error is puzzling.