Troubleshooting¶
Controller Issues¶
Getting errors such as Cannot redeclare drawmenu (previously declared…) The problem is most likely that you called a printError() function, or something which started the theme output, and did not return. Then another part of the program called the theme output again.
Theme output already started¶
This gets printed when the theme->render() function is being called a second time. Typically this will be related to a print_error() call and where the controller does not immediately return, but rather continues on and subsequently calls theme->render(). Look for Form->init() statements that do not return on error.
Calendar popup issues¶
When a date input field is at the bottom of a page, the calendar tends to pop-up at the top of the page. Here is some code which should correct the problem:
$('#date').click(function() {
var top = parseInt($(this).position().top);
$('.DynarchCalendar-topCont').css({'top': top + 20});
window.scrollTo(0, document.body.scrollHeight);
});
Logging Errors¶
Use the CodeIgniter function log_message() to write to the daily error log. Here’s an example:
log_message('error', "Could not open '$cssfile' for writing.");