Topic: db_pager.inc and session.inc inclusion order

 new_db_pager(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "db_pager" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in file: /var/www/fa/242/includes/db_pager.inc at line 487

I can't identify the reason for this issue,  when the db_pager loads it works fine, But when i click on next page. it throws the above error.

How do i solve this issue. ?

Subscription service based on FA
HRM CRM POS batch Themes

Re: db_pager.inc and session.inc inclusion order

Provide context. The standard FA works fine with db_pager. Hence it must be a $path_to_root or include_once  issue.

Re: db_pager.inc and session.inc inclusion order

 $cols = array(
        _("Empl Id") => array('name'=>'empl_id'),
        _("Empl Name") => array('name'=>'empl_name'),       
        _("Email") => array('name'=>'email'),
        _("Mobile No") => array('name'=>'email'),
        _("Department") => array('name'=>'email'),
        _("Grade") => array('name'=>'grade'),
        _("Present Address") => array('name'=>'present_address'),
        _("Date of Join") => array('name'=>'tran_date', 'type'=>'date'),
        array('insert'=>true, 'fun'=>'edit_link'),
        array('insert'=>true, 'fun'=>'delete_link')
    );    
    $table =& new_db_pager('info', $sql, $cols, null, null, 2);
    $table->set_marker('is_inactive', _("Marked Employees are either Terminated,Retired,Deceased,Suspended."), 'warning_msg', 'warning_bottom_msg');
    $table->width = "80%";
    display_db_pager($table);

This code within the form and ofcourse it works fine for the core functions like search dimension and gl inquiry.

I think, its not a problem (include_once or $path_to_root).  May be the functionality i wrote is not right.

Subscription service based on FA
HRM CRM POS batch Themes

Re: db_pager.inc and session.inc inclusion order

Even providing the whole file here may not be useful. Check your functionality and provide feedback.

Re: db_pager.inc and session.inc inclusion order

Thanks for the advice. Actually providing the whole may help to fix the issue.
anyhow let me tell you the solution, it may either helpful to someone who makes db_pager and stuck this issue,

This one wont work

 include($path_to_root . "/includes/session.inc");
include($path_to_root . "/includes/db_pager.inc");
 

and this works fine.

 include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc"); 

So the problem is not getting session before pager class.

Subscription service based on FA
HRM CRM POS batch Themes

Re: db_pager.inc and session.inc inclusion order

That is indeed a good find.

The function display_db_pager() is defined in includes/ui/db_pager_view.inc which is "include"d in includes/db_pager.inc which is "include"d in each table display page. All such pages have your stated order of "include".

The pager routines have no need for page security which is used by the session file which needs to come in later. It is possible that some routines in the pager files may be needed by the session file.

There are functions, includes and code outside of the class definition in the session file. Such includes too may need functions available in the pager files that hence need to precede the session file in order of inclusion.

Re: db_pager.inc and session.inc inclusion order

smile

Subscription service based on FA
HRM CRM POS batch Themes