1 (edited by neholtz 05/02/2019 07:45:57 pm)

Topic: Code lines skipped - then blank display ver 2.4.6

Several lines of code are skipped after a successful call to write a new database record.

For example:

    call_to_write_new_database_record(.........);          // This completes successfully - no errors

    display_notification(_('New record successfully written'));     // This and the following lines do not execute
//
// other lines of code *
//
}

A blank page is now displayed.

* There are no errors in the other lines of code.

Re: Code lines skipped - then blank display ver 2.4.6

Is $go_debug = 1; (or 2) set in config.php?
Anything in the error log?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Code lines skipped - then blank display ver 2.4.6

$go_debug = 2 and nothing in error logs or /tmp

Re: Code lines skipped - then blank display ver 2.4.6

The function display_notification() is defined in includes/ui/ui_msgs.inc and needs to be included in your script if not already loaded by some other included script.

The second argument in the said function defaults to true anyway and can be omitted in the second call.

Re: Code lines skipped - then blank display ver 2.4.6

Thanks @apmuthu, but all includes done at top. see below:

$page_security = 'SA_NEWLNKS';
$path_to_root  = '../../..';

$module_root = $path_to_root . "/modules/BatchControl";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($module_root  . "/includes/batches_db.inc");

add_access_extensions();

$js = "";
if ($SysPrefs->use_popup_windows)
    $js .= get_js_open_window(720, 640);
if (user_use_date_picker())
    $js .= get_js_date_picker();

page(_($help_context = "Batch Control"));

simple_page_mode(true);

$link_id   = '';
$batch_ref = '';
$trans_id  = '';
$target    = '';
$link      = '';
$noTab     = false;

I have used that function a number of times in three different modules, so I cannot understand why all the code below the call_to_write_new_database_record function is being skipped as it all resides within the same section.

Will try re-typing that section.

Re: Code lines skipped - then blank display ver 2.4.6

Check where you took the snippet from and do a WinMerge compare for diffs and see if there are any syntax / sequence order issues for the lines of code.