4.3.1 - Block Status Errors In Block.php

I'm getting some errors since upgrading to 4.3.1

It's related to the status change of a block

The error report is consistent and the only error being generated by the shop.

It occurs when the block status is changed.

It logs the same two lines.



PHP Notice: Undefined index: object_ids in /home/site/public_html/cart/app/Tygh/BlockManager/Block.php on line 615

PHP Notice: Undefined index: status in /home/site/public_html/cart/app/Tygh/BlockManager/Block.php on line 619




The section of code it's referring to in Block.php is:



/**
* Updates block statuses
* $status_data must be array with these fields:
*

array (
* snapping_id - if not exists will be created new record
* status - block status 'A', 'D'
* object_ids - dynamic object id
* object_type - dynamic object type from dynamic_objects scheme
* )

*
* @param array $status_data Array of status data
* @return string|bool Status value on success, false otherwise
*/
public function updateStatus($status_data)
{
if (!empty($status_data['snapping_id']) && !empty($status_data['status'])) {
if (!empty($status_data['object_type']) && !empty($status_data['object_id']) && $status_data['object_id'] > 0) {
// If it's status update for dynamic object
$block = $this->getById(null, $status_data['snapping_id'], $status_data, DESCR_SL);
(LINE 615) $object_ids = explode(',', $block['object_ids']);

$key = array_search($status_data['object_id'], $object_ids);

(LINE 619) if ($status_data['status'] == $block['status'] && isset($object_ids[$key])) {
unset($object_ids[$key]);
} elseif ($status_data['status'] != $block['status']) {
$object_ids[] = $status_data['object_id'];
}
foreach ($object_ids as $k => $v) {
if (empty($v)) {
unset($object_ids[$k]);
}
}
$status_data['object_ids'] = implode(',', $object_ids);
if (empty($status_data['object_ids'])) {
db_query('DELETE FROM ?:bm_block_statuses WHERE object_type=?s and snapping_id=?i', $status_data['object_type'], $status_data['snapping_id']);
} else {
$this->updateStatuses($status_data);
}
} else {
// If it's simple status update just do it
$this->updateSnapping(array(
'snapping_id' => $status_data['snapping_id'],
'status' => $status_data['status'],
'object_ids' => '',
'object_type' => ''
));
}
return $status_data['status'];
} else {
return false;
}
}

[quote name='musicsite' timestamp='1435045030' post='220022']

I'm getting some errors since upgrading to 4.3.1

It's related to the status change of a block

The error report is consistent and the only error being generated by the shop.

It occurs when the block status is changed.

It logs the same two lines.



PHP Notice: Undefined index: object_ids in /home/site/public_html/cart/app/Tygh/BlockManager/Block.php on line 615

PHP Notice: Undefined index: status in /home/site/public_html/cart/app/Tygh/BlockManager/Block.php on line 619




The section of code it's referring to in Block.php is:

[/quote]



Try the fix from this report. See the last message: http://forum.cs-cart.com/tracker/issue-5778-cannot-enable-main-containter