Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions oc-includes/osclass/controller/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ function doModel()
$result = $mItem->contact();

osc_run_hook('post_item_contact_post', $item);
if(is_string($result)){

if(is_string($result)) {
osc_add_flash_error_message( $result );
} else {
osc_add_flash_ok_message( _m("We've just sent an e-mail to the seller") );
Expand Down Expand Up @@ -528,6 +529,8 @@ function doModel()
}

// View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey(Params::getParam('id')));

osc_run_hook('post_item_add_comment_post', $item);
$this->redirectTo( osc_item_url() );
break;
case 'delete_comment':
Expand Down Expand Up @@ -572,9 +575,10 @@ function doModel()
$this->redirectTo( osc_item_url() );
}

$commentManager->deleteByPrimaryKey($commentId);
osc_add_flash_ok_message( _m('The comment has been deleted' ) );
$this->redirectTo( osc_item_url() );
$commentManager->deleteByPrimaryKey($commentId);
osc_add_flash_ok_message( _m('The comment has been deleted' ) );
osc_run_hook('post_item_delete_comment_post', $item, $commentId);
$this->redirectTo( osc_item_url() );
break;
default:
// if there isn't ID, show an error 404
Expand Down