Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
I can't seem to be able to display commenting form using the aurelia template. I keep getting this error

select( K_TBL_COMMENTS . " cc inner join ".K_TBL_TEMPLATES." ct on ct.id=cc.tpl_id", array('cc.*, ct.name tpl_name, ct.clonable'), "cc.id='" . $DB->sanitize( $id ). "'" ); if( count($rs) ){ $row = $rs[0]; foreach( $row as $k=>$v ){ if( isset($this->$k ) ) $this->$k = $v; } $this->populate_fields(); // HOOK: comment_loaded $FUNCS->dispatch_event( 'comment_loaded', array(&$this) ); } } function populate_fields(){ global $FUNCS; if( count($this->fields) ) return; $fields = array( 'name'=>$FUNCS->t('name'), /*'Name',*/ 'email'=>$FUNCS->t('email'), /*'Email',*/ 'link'=>$FUNCS->t('website'), /*'Website',*/ 'data'=>$FUNCS->t('comment'), /*'Comment',*/ 'date'=>$FUNCS->t('submitted_on'), 'approved'=>$FUNCS->t('status'), 'dummy'=>'', ); foreach( $fields as $k=>$v ){ $field_info = array( 'id' => -1, 'name' => '', 'label' => '', 'k_desc' => '', 'k_type' => 'text', 'hidden' => '0', 'data' => '', 'required' => '1', 'validator' => '', 'system' => '1', 'module' => 'comments', ); $field_info['name'] = 'k_'.$k; $field_info['label'] = $v; $field_info['data'] = $this->$k; if( $k=='date' ){ $this->fields[] = new KCommentDateField( $field_info, $this, $this->fields ); } elseif( $k=='approved' ){ $this->fields[] = new KSingleCheckField( $field_info, $this, $this->fields, $FUNCS->t('approved') ); } else{ if( $k=='email' ){ $field_info['validator'] = 'email'; } elseif( $k=='link' ){ $field_info['required'] = '0'; } elseif( $k=='data' ){ $field_info['k_type'] = 'richtext'; $field_info['toolbar'] = 'basic'; } elseif( $k=='dummy' ){ $field_info['system'] = '0'; $field_info['required'] = '0'; $field_info['no_render'] = '1'; } $this->fields[] = new KField( $field_info, $this, $this->fields ); } } // HOOK: alter_comment_fields_info $FUNCS->dispatch_event( 'alter_comment_fields_info', array(&$this->fields, &$this) ); } function get_link(){ global $FUNCS; $parent_link = ( K_PRETTY_URLS ) ? $FUNCS->get_pretty_template_link( $this->tpl_name ) : $this->tpl_name; return K_SITE_URL . $parent_link . "?comment=" . $this->id; } function save(){ global $AUTH, $FUNCS, $DB; $DB->begin(); // Serialize access $DB->select( K_TBL_PAGES, array('comments_count'), "id='" . $DB->sanitize( $this->page_id ). "' FOR UPDATE" ); // HOOK: comment_presave // the save process is about to begin. // Field values can be adjusted before subjecting them to the save routine. $FUNCS->dispatch_event( 'comment_presave', array(&$this) ); // HOOK: comment_prevalidate // all fields are ready for validation. Do any last minute tweaking before validation begins. $FUNCS->dispatch_event( 'comment_prevalidate', array(&$this->fields, &$this) ); // Validate all system fields before persistng changes $errors = 0; for( $x=0; $xfields); $x++ ){ $f = &$this->fields[$x]; if( !$f->validate() ) $errors++; } // HOOK: comment_validate // can add some custom validation here if required. $FUNCS->dispatch_event( 'comment_validate', array(&$this->fields, &$errors, &$this) ); if( $errors ){ $DB->rollback(); return $errors; } $arr_update = array(); unset( $f ); for( $x=0; $xfields); $x++ ){ $f = &$this->fields[$x]; if( $f->system ){ $name = substr( $f->name, 2 ); // remove the 'k_' prefix from system fields $prev_value = $this->$name; $this->$name = $arr_update[$name] = $f->get_data(); } unset( $f ); } // HOOK: alter_comment_update $FUNCS->dispatch_event( 'alter_comment_update', array(&$arr_update, &$this->fields, &$this) ); // persist changes $rs = $DB->update( K_TBL_COMMENTS, $arr_update, "id='" . $DB->sanitize( $this->id ). "'" ); if( $rs==-1 ) die( "ERROR: Unable to save data in K_TBL_COMMENTS" ); // adjust comments count for the page $rs = $FUNCS->update_comments_count( $this->page_id ); if( $FUNCS->is_error($rs) ) die( "ERROR: Unable to update comments count in K_TBL_PAGES" ); // HOOK: comment_updated $FUNCS->dispatch_event( 'comment_updated', array(&$this, &$errors) ); if( $errors ){ $DB->rollback(); return $errors; } $DB->commit(); // Invalidate cache //$FUNCS->invalidate_cache(); } function approve( $approve=1 ){ global $DB, $FUNCS; if( $this->id != -1 && ($approve==1 || $approve==0) ){ $DB->begin(); // Serialize access $DB->select( K_TBL_PAGES, array('comments_count'), "id='" . $DB->sanitize( $this->page_id ). "' FOR UPDATE" ); $rs = $DB->update( K_TBL_COMMENTS, array('approved'=>$approve), "id='" . $DB->sanitize( $this->id ). "'" ); if( $rs==-1 ) die( "ERROR: Unable to update data in K_TBL_COMMENTS" ); // adjust comments count for the page $rs = $FUNCS->update_comments_count( $this->page_id ); if( $FUNCS->is_error($rs) ) die( "ERROR: Unable to update comments count in K_TBL_PAGES" ); // HOOK: comment_approved $FUNCS->dispatch_event( 'comment_approved', array(&$this) ); $DB->commit(); $this->approved = $approve; // Invalidate cache $FUNCS->invalidate_cache(); } } function delete(){ global $DB, $FUNCS; // remove comment if( $this->id != -1 ){ $DB->begin(); // Serialize access $DB->select( K_TBL_PAGES, array('comments_count'), "id='" . $DB->sanitize( $this->page_id ). "' FOR UPDATE" ); // HOOK: comment_predelete $FUNCS->dispatch_event( 'comment_predelete', array(&$this) ); $rs = $DB->delete( K_TBL_COMMENTS, "id='" . $DB->sanitize( $this->id ). "'" ); if( $rs==-1 ) die( "ERROR: Unable to delete comment from K_TBL_COMMENTS" ); // adjust comments count for the page $rs = $FUNCS->update_comments_count( $this->page_id ); if( $FUNCS->is_error($rs) ) die( "ERROR: Unable to update comments count in K_TBL_PAGES" ); // HOOK: comment_deleted $FUNCS->dispatch_event( 'comment_deleted', array(&$this) ); $DB->commit(); $this->id = -1; // Invalidate cache $FUNCS->invalidate_cache(); } } }// end class KComments

What could be the problem?
Hi,

I'll need to take a look at the issue first-hand.

If your site is online, could you please PM me the FTP+Couch access creds?

Thanks.
2 posts Page 1 of 1