Blog comment confirmation email sends wrong link with no id

edited November 2012 in News & Announcements
In the blog controller in function _notify:
1. $msg .= "\n".fuel_url('blog/comments/'.$comment->id)."\n\n";
Should probably be:
$msg .= "\n".fuel_url('blog/comments/edit'.$comment->id)."\n\n";

2. The $comment->id is empty, how do I get the comment id that was just created?
[table_name:protected] => fuel_blog_comments
[key_field:protected] => id
[normalized_save_data:protected] => Array
(
[id] =>
[post_id] => 2
[parent_id] =>
[author_id] =>
[author_name] => Sigi
[author_email] => sigi@gmail.com
[author_website] =>
[author_ip] => 127.0.0.1
[is_spam] => no
[content] => Here is the comment
[published] => no
[date_added] =>
[last_modified] => CURRENT_TIMESTAMP
[title] =>
[permalink] =>
)

Comments

  • edited 12:34PM
    There is an issue in MY_Model that isn't returning the id after save. I've posted a fix for 0.93:
    https://github.com/daylightstudio/FUEL-CMS/commit/25c0cea6373cc85f73aa18102fa6741b9bd11dd0

    This is not an issue on 1.0
  • edited 12:34PM
    I've added your fix but not sure I did it right since it didn't fix the problem.
    My_Model is like that now:
    // execute on_insert/update hook methods on the Date_record model if exists if (is_object($record) AND is_a($record, 'Data_record')) { //if (!$this->_has_key_field_value($values) AND $this->db->insert_id()) if($no_key) { $record->on_after_insert($values); } else { $record->on_after_update($values); } }
  • edited 12:34PM
    I think you may have missed part of the code. Try replacing the whole MY_Model file.
  • edited 12:34PM
    Thanks that helped.
Sign In or Register to comment.