Problema con framework 0.4.7a y Postgres

edited septiembre 2008 in Dudas/Problemas
Hola , soy nuevo en el foro y estamos empezando a probar el framework para adoptarlo para un proyecto , y estamos probando un ejemplo con postgres y nos da el siguiente error al insertar un registro :

KumbiaException: No se ha definido una llave primaria para la tabla 'autor' esto imposibilita crear el ActiveRecord para esta entidad

En el archivo /opt/lampp/htdocs/demo/forms/db/active_record.php en la l?nea: 308

#0 /opt/lampp/htdocs/demo/forms/controller/standard_form_controller.php(191): ActiveRecord->dump()
#1 [internal function]: StandardForm->insert()
#2 /opt/lampp/htdocs/demo/kumbia.php(201): call_user_func_array(Array, Array)
#3 /opt/lampp/htdocs/demo/public/index.php(76): Kumbia::main()
#4 {main}

Estamos usando la versión 0.4.7a del framework , con postgres 8.3 , en un linux ubuntu 7.1 con XAmpp.

El controlador "autor_controller.php" está definido de la siguiente forma :

<?php
class AutorController extends StandardForm {
public $scaffold = true;
}
?>

El modelo "autor.php" de la siguiente :

<?php
class Autor extends ActiveRecord {
}
?>

La estructura de la tabla en la base de datos es la siguiente :

CREATE TABLE autor
(
id serial NOT NULL,
nombre varchar(50) NOT NULL,
apellido varchar(50)[] NOT NULL,
fecha_nacimiento date NOT NULL,
fecha_defuncion date,
CONSTRAINT pk_autor PRIMARY KEY (id)
)
WITHOUT OIDS;
ALTER TABLE autor OWNER TO postgres;

Comentarios

  • edited 9:34
    Modifiqué la estructura de la tabla en postgres y ahora obtengo el siguiente error :

    Estructura de la tabla :

    CREATE TABLE autor
    (
    id bigserial NOT NULL,
    nombre varchar(50) NOT NULL,
    apellido varchar(50) NOT NULL,
    fecha_nacimiento date NOT NULL,
    fecha_defuncion date,
    CONSTRAINT primary_key PRIMARY KEY (id)
    )
    WITHOUT OIDS;
    ALTER TABLE autor OWNER TO postgres;

    Nuevo Error :

    KumbiaWarning: Propiedad no definida
    Propiedad indefinida '' asignada en el modelo 'autor' ()
    En el modelo autor al ejecutar autor/insert/

    #0 ActiveRecordException::display_warning(Propiedad no definida, Propiedad indefinida '' asignada en el modelo 'autor' (), autor) called at [/opt/lampp/htdocs/demo/forms/db/active_record.php:189]
    #1 ActiveRecord->__set(, ) called at [/opt/lampp/htdocs/demo/forms/controller/standard_form_controller.php:195]
    #2 StandardForm->insert()
    #3 call_user_func_array(Array ([0] => AutorController Object ([scaffold] => 1,[controller_name] => autor,[action_name] => insert,[id] => ,[ignore_list] => Array (),[form] => Array ([components] => Array ([id] => Array ([auto_numeric] => 1,[primary] => 1,[notNull] => 1,[valueType] => numeric,[attributes] => Array ([size] => 20,[maxlength] => 64),[type] => text,[caption] => Id),[nombre] => Array ([notNull] => 1,[attributes] => Array ([size] => 20,[maxlength] => 54),[type] => text,[caption] => Nombre),[apellido] => Array ([notNull] => 1,[attributes] => Array ([size] => 20,[maxlength] => 54),[type] => text,[caption] => Apellido),[fecha_nacimiento] => Array ([valueType] => date,[notNull] => 1,[attributes] => Array ([size] => 20,[maxlength] => 32),[type] => text,[caption] => Fecha Nacimiento),[fecha_defuncion] => Array ([valueType] => date,[attributes] => Array ([size] => 20,[maxlength] => 32),[type] => text,[caption] => Fecha Defuncion)),[source] => autor,[caption] => Autor,[type] => standard,[scaffold] => ,[force] => ),[cache_layout] => ,[cache_view] => ,[view] => index,[keep_action] => ,[sucess_insert_message] => ,[failure_insert_message] => ,[success_update_message] => ,[failure_update_message] => ,[success_delete_message] => ,[failure_delete_message] => ,[response] => ,[all_parameters] => Array ([0] => autor,[1] => insert),[parameters] => Array (),[source] => autor,[Autor] => Autor Object ([db] => ,[schema] => ,[source] => autor,[count] => ,[fields] => Array ([0] => ,[1] => ,[2] => ,[3] => ,[4] => ),[primary_key] => Array (),[non_primary] => Array ([0] => ,[1] => ,[2] => ,[3] => ,[4] => ),[not_null] => Array (),[attributes_names] => Array ([0] => ,[1] => ,[2] => ,[3] => ,[4] => ),[attributes] => ,,,,,[is_view] => ,[debug] => ,[logger] => ,[persistent] => ,[dynamic_update] => ,[dynamic_insert] => ,[select_before_update] => ,[subselect] => ,[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => Array (),[] => ,[] => 1,[] => ,[] => Array ([] => ),[] => Array (),[] => Array (),[] => Array ())),[1] => insert), Array ()) called at [/opt/lampp/htdocs/demo/kumbia.php:201]
    #4 Kumbia::main() called at [/opt/lampp/htdocs/demo/public/index.php:76]
  • Realiza estas mismas pruebas con la version 0.5 estos son Bug's muy viejos, esta semana se estara publicando un manual relacionado con esa version!
  • edited 9:34
    Es correcto.... con la versión 0.5 del framework funciona correctamente ...
    Gracias ... y esperamos la documentación ...

    Saludos...
Sign In or Register to comment.