Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error a la hora de guardar datos
#1
Buenos días:
Hoy de golpe me ha salido este error, sin modificar nada

Fatal error: Call to a member function FetchRow() on boolean in /home/xxxx/public_html/corebos/include/database/PearDatabase.php on line 668

Alguna idea de lo que puede ser?
Reply
#2
Activa el log de depuración, encontrarás un error de SQL, eso te dirá lo que ha pasado.
Joe
TSolucio
Reply
#3
No genera nigún archivo en la carpeta logs, estará en los logs del servidor?
Reply
#4
Lee con detenimiento las instrucciones, tienes que hacer dos cosas para que aparezcan los mensajes:

$LOG4PHP_DEBUG = true;

en config.inc.php

log4php.rootLogger = DEBUG, A1

en log4php.properties

también asegurate que los permisos en el directorio son los correctos y el usuario apache puede escribir en el directorio

http://corebos.org/documentation/doku.php?id=en:devel:debuging#php
Joe
TSolucio
Reply
#5
Bien he encontrado este error en la consulta que realiza de la base de datos

2018-07-14T08:38:18+00:00 DEBUG index Prepared sql query being executed : SELECT vtiger_crmentity.*, vtiger_llamadasrecibidas.*, CASE WHEN (vtiger_users.user_name NOT LIKE '') THEN CONCAT(vtiger_users.first_name,' ',vtiger_users.last_name) ELSE vtiger_groups.groupname END AS user_name, vtiger_llamadasrecibidascf.* FROM vtiger_llamadasrecibidas INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_llamadasrecibidas.llamadasrecibidasid LEFT JOIN vtiger_llamadasrecibidascf ON vtiger_llamadasrecibidascf.llamadasrecibidasid = vtiger_llamadasrecibidas.llamadasrecibidasid INNER JOIN vtiger_contactdetails ON (vtiger_contactdetails.contactid = vtiger_llamadasrecibidascf.cf_859) LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid WHERE vtiger_crmentity.deleted = 0 AND vtiger_contactdetails.contactid = 1542 ORDER BY vtiger_llamadasrecibidas.llamadasrecibidas ASC LIMIT 0, 35
2018-07-14T08:38:18+00:00 INFO VT PearDatabase ->ADODB error Query Failed:SELECT vtiger_crmentity.*, vtiger_llamadasrecibidas.*, CASE WHEN (vtiger_users.user_name NOT LIKE '') THEN CONCAT(vtiger_users.first_name,' ',vtiger_users.last_name) ELSE vtiger_groups.groupname END AS user_name, vtiger_llamadasrecibidascf.* FROM vtiger_llamadasrecibidas INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_llamadasrecibidas.llamadasrecibidasid LEFT JOIN vtiger_llamadasrecibidascf ON vtiger_llamadasrecibidascf.llamadasrecibidasid = vtiger_llamadasrecibidas.llamadasrecibidasid INNER JOIN vtiger_contactdetails ON (vtiger_contactdetails.contactid = vtiger_llamadasrecibidascf.cf_859) LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid WHERE vtiger_crmentity.deleted = 0 AND vtiger_contactdetails.contactid = 1542 ORDER BY vtiger_llamadasrecibidas.llamadasrecibidas ASC LIMIT 0, 35::->[1054]Unknown column 'vtiger_llamadasrecibidas.llamadasrecibidas' in 'order clause'
2018-07-14T08:38:18+00:00 INFO VT PearDatabase ->ADODB disconnect

Parece que no encuentra el campo vtiger_llamadasrecibidas.llamadasrecibidas en el orden ORDER BY vtiger_llamadasrecibidas.llamadasrecibidas ASC LIMIT 0, 35::->[1054]Unknown column 'vtiger_llamadasrecibidas.llamadasrecibidas' in 'order clause' y es normal ya que el campo por el que tendría que ordenar es el vtiger_llamadasrecibidas.llamadasrecibidasid

¿Alguna idea de por qué construye así la consulta?

Los datos los guarda en la base de datos correctamente, pero cuando hace la consulta salta ese error ¿Por qué?
Reply
#6
El mensaje es bastante claro, el campo no existe. ¿Has probado a ejecutar el comando directamente en myqsl? ¿también te da ese error? ¿no estará mal escrito el nombre del campo?
Joe
TSolucio
Reply
#7
También he visto este error
2018-07-14T09:56:06+00:00 INFO VT PearDatabase ->ADODB error Query FailedConfusedelect .,vtiger_llamadasrecibidas.llamadasrecibidas_no ,vtiger_crmentity.crmid FROM vtiger_llamadasrecibidas INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_llamadasrecibidas.llamadasrecibidasid INNER JOIN vtiger_llamadasrecibidascf ON vtiger_llamadasrecibidascf.llamadasrecibidasid = vtiger_llamadasrecibidas.llamadasrecibidasid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_account ON vtiger_account.accountid = vtiger_llamadasrecibidascf.cf_856 LEFT JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_llamadasrecibidascf.cf_859 WHERE vtiger_llamadasrecibidas.llamadasrecibidasid > 0 AND vtiger_crmentity.deleted = 0 and (vtiger_llamadasrecibidas.llamadasrecibidas_no LIKE '%JOSE ANTONIO%' OR 0. LIKE '%JOSE ANTONIO%' OR vtiger_crmentity.smownerid LIKE '%JOSE ANTONIO%' OR vtiger_crmentity.smcreatorid LIKE '%JOSE ANTONIO%' OR vtiger_crmentity.createdtime LIKE '%JOSE ANTONIO%' OR vtiger_crmentity.modifiedtime LIKE '%JOSE ANTONIO%' OR vtiger_crmentity.description LIKE '%JOSE ANTONIO%' OR vtiger_llamadasrecibidascf.cf_856 LIKE '%JOSE ANTONIO%' OR vtiger_llamadasrecibidascf.cf_857 LIKE '%JOSE ANTONIO%' OR vtiger_llamadasrecibidascf.cf_858 LIKE '%JOSE ANTONIO%' OR vtiger_llamadasrecibidascf.cf_859 LIKE '%JOSE ANTONIO%') LIMIT 0, 20::->[1064]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'vtiger_llamadasrecibidas.llamadasrecibidas_no ,vtiger_crmentity.crmid FROM vtige' at line 1
Reply
#8
en este faltan campos, seguramente algún error en la construcción del módulo. Revisa los campos del filtro All y de las listas relacionadas.
Joe
TSolucio
Reply
#9
Es posible que el error de la generación de la consulta, esté en el archivo php del módulo en cuestión?

Este es el contenido que tengo en el archivo del modulo LlamadasRecibidas.php

<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright © vtiger.
* All Rights Reserved.
************************************************************************************/
require_once 'data/CRMEntity.php';
require_once 'data/Tracker.php';

class llamadasrecibidas extends CRMEntity {
public $db;
public $log;

public $table_name = 'vtiger_llamadasrecibidas';
public $table_index= 'llamadasrecibidasid';
public $column_fields = array();

/** Indicator if this is a custom module or standard module */
public $IsCustomModule = true;
public $HasDirectImageField = false;
/**
* Mandatory table for supporting custom fields.
*/
public $customFieldTable = array('vtiger_llamadasrecibidascf', 'llamadasrecibidasid');
// related_tables variable should define the association (relation) between dependent tables
// FORMAT: related_tablename => array(related_tablename_column[, base_tablename, base_tablename_column[, related_module]] )
// Here base_tablename_column should establish relation with related_tablename_column
// NOTE: If base_tablename and base_tablename_column are not specified, it will default to modules (table_name, related_tablename_column)
// Uncomment the line below to support custom field columns on related lists
// var $related_tables = array('vtiger_llamadasrecibidascf' => array('llamadasrecibidasid', 'vtiger_llamadasrecibidas', 'llamadasrecibidasid', 'llamadasrecibidas'));

/**
* Mandatory for Saving, Include tables related to this module.
*/
public $tab_name = array('vtiger_crmentity', 'vtiger_llamadasrecibidas', 'vtiger_llamadasrecibidascf');

/**
* Mandatory for Saving, Include tablename and tablekey columnname here.
*/
public $tab_name_index = array(
'vtiger_crmentity' => 'crmid',
'vtiger_llamadasrecibidas' => 'llamadasrecibidasid',
'vtiger_llamadasrecibidascf' => 'llamadasrecibidasid',
);

/**
* Mandatory for Listing (Related listview)
*/
public $list_fields = array (
/* Format: Field Label => array(tablename => columnname) */
// tablename should not have prefix 'vtiger_'
'LlamadasRecibidas'=> array('llamadasrecibidas' => 'llamadasrecibidasid'),
'Assigned To' => array('crmentity' => 'smownerid')
);
public $list_fields_name = array(
/* Format: Field Label => fieldname */
'LlamadasRecibidas'=> 'llamadasrecibidasid',
'Assigned To' => 'assigned_user_id'
);

// Make the field link to detail view from list view (Fieldname)
public $list_link_field = 'llamadasrecibidas';

// For Popup listview and UI type support
public $search_fields = array(
/* Format: Field Label => array(tablename => columnname) */
// tablename should not have prefix 'vtiger_'
'LlamadasRecibidas'=> array('llamadasrecibidas' => 'llamadasrecibidasid')
);
public $search_fields_name = array(
/* Format: Field Label => fieldname */
'LlamadasRecibidas'=> 'llamadasrecibidas'
);

// For Popup window record selection
public $popup_fields = array('llamadasrecibidas');

// Placeholder for sort fields - All the fields will be initialized for Sorting through initSortFields
public $sortby_fields = array();

// For Alphabetical search
public $def_basicsearch_col = 'llamadasrecibidas';

// Column value to use on detail view record text display
public $def_detailview_recname = 'llamadasrecibidas';

// Required Information for enabling Import feature
public $required_fields = array('llamadasrecibidas'=>1);

// Callback function list during Importing
public $special_functions = array('set_import_assigned_user');

public $default_order_by = 'llamadasrecibidasid';
public $default_sort_order='DESC';
// Used when enabling/disabling the mandatory fields for the module.
// Refers to vtiger_field.fieldname values.
public $mandatory_fields = array('createdtime', 'modifiedtime', 'llamadasrecibidas');

public function save_module($module) {
if ($this->HasDirectImageField) {
$this->insertIntoAttachment($this->id, $module);
}
}

/**
* Invoked when special actions are performed on the module.
* @param String Module name
* @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
*/
public function vtlib_handler($modulename, $event_type) {
if ($event_type == 'module.postinstall') {
// TODO Handle post installation actions
$this->setModuleSeqNumber('configure', $modulename, $modulename.'-', '0000001');
} elseif ($event_type == 'module.disabled') {
// TODO Handle actions when this module is disabled.
} elseif ($event_type == 'module.enabled') {
// TODO Handle actions when this module is enabled.
} elseif ($event_type == 'module.preuninstall') {
// TODO Handle actions when this module is about to be deleted.
} elseif ($event_type == 'module.preupdate') {
// TODO Handle actions before this module is updated.
} elseif ($event_type == 'module.postupdate') {
// TODO Handle actions after this module is updated.
}
}

/**
* Handle saving related module information.
* NOTE: This function has been added to CRMEntity (base class).
* You can override the behavior by re-defining it here.
*/
// public function save_related_module($module, $crmid, $with_module, $with_crmid) { }

/**
* Handle deleting related module information.
* NOTE: This function has been added to CRMEntity (base class).
* You can override the behavior by re-defining it here.
*/
//public function delete_related_module($module, $crmid, $with_module, $with_crmid) { }

/**
* Handle getting related list information.
* NOTE: This function has been added to CRMEntity (base class).
* You can override the behavior by re-defining it here.
*/
//public function get_related_list($id, $cur_tab_id, $rel_tab_id, $actions=false) { }

/**
* Handle getting dependents list information.
* NOTE: This function has been added to CRMEntity (base class).
* You can override the behavior by re-defining it here.
*/
//public function get_dependents_list($id, $cur_tab_id, $rel_tab_id, $actions=false) { }
}
?>

Faltan los campos?, con este archivo realiza todas las construcciones de las consultas que realiza COREBOS?
Reply
#10
los array search_fields y list_fields están mal. El fomato es:

/* Format: Field Label => array(tablename => columnname) */

O sea, etiqueta de campo y nombre de la columna del campo que se muestra en pantalla. Pero estás utilizando llamadasrecibidasid que es un campo interno de la tabla y no se puede mostrar en pantalla.

'LlamadasRecibidas'=> array('llamadasrecibidas' => 'llamadasrecibidasid')
Joe
TSolucio
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)