Php Error In Fn.database.php

See a lot of Fun.database.php errors for line 505 which is:

$params['sort_order_rev'] = $directions[$params['sort_order']];

Any idea what could be causing this?

Also seeing this error repeat a lot for a calculation add-on:

function fn_price_calculation_get_product_option_data_post(&$opt, $product_id, $lang_code){
	if ($opt['option_type']=="N"){
		$opt['csc_price'] = db_get_row("SELECT * FROM ?:calc_defaults WHERE option_id = ?i", $opt['option_id']);

Anyone see anything wrong with that? All this is a little over my head but just trying to get things resolved since my backend has been running slow randomly.

It'd be best to post the error info and CSC version.

It'd be best to post the error info and CSC version.

Yeah, that may help. This is V4.11.4 SP3 and for the fn.database.php error it is;

Undefined index: in /home/mysite/public_html/shop/app/functions/fn.database.php on line 505

For the calculations add on it is:

Undefined index: option_type in /home/mysite/public_html/shop/app/addons/price_calculation/func.php on line 314

There are a few changes in the latest fn.database.php file (particularly with the function you're having an issue with) so save a backup of the file and replace it with the attached and see if that helps.

The second issue will need to be addressed by the developer.