Pregunta

Tratando de utilizar los módulos: Jelly-Auth y Jelly-Formo está causando 2 errores. Dependiendo de cómo yo arregle mi archivo boostrap puedo deshacerme de un error u otro, pero no ambos ...

Error 1: autenticación funciona bien, formo sin que: http://wellcommentedcode.com/stack_questions/formo.jpg

Kohana::modules(array(
  'database'    => MODPATH.'database',   // Database access

  'jelly'       => MODPATH.'jelly',   // Jelly ORM

  'jelly-auth'  => MODPATH.'jelly-auth',       // Basic authentication & Jelly
  'auth'        => MODPATH.'auth',       // Basic authentication

  'formo-jelly' => MODPATH.'formo-jelly',   // Easy forms & Jelly
  'formo'       => MODPATH.'formo',   // Easy forms
  ));

Error 2: Formo funciona bien, las pausas en la validación de autenticación: http://wellcommentedcode.com/stack_questions/formo-auth.jpg

Kohana::modules(array(
  'database'    => MODPATH.'database',   // Database access

  'formo-jelly' => MODPATH.'formo-jelly',   // Easy forms & Jelly
  'formo'       => MODPATH.'formo',   // Easy forms

  'jelly'       => MODPATH.'jelly',   // Jelly ORM

  'jelly-auth'  => MODPATH.'jelly-auth',       // Basic authentication & Jelly
  'auth'        => MODPATH.'auth',       // Basic authentication
));

Cualquier ayuda sería muy apreciada ... gracias ...

Actualización: Me error 2 fijo en una especie de hacker camino ... un método mejor sería apreciada ...

I simplemente comentada línea 81 y 82 de formo-jelly / clases / jalea / model.php

Me gustaría ser capaz de utilizar la validación gelatinosa formo ... pero ya que está causando problemas con la validación de autenticación en este momento ... estoy dispuesto a desechar esas dos líneas por el momento ...

81: if ( ! $this->form->validate(TRUE))
82:     throw new Validator_Exception($this->form->errors(), 'Failed to validate form');
¿Fue útil?

Solución

La incompatibilidad entre los módulos viene de kohana-formo-jelly / clases / jalea / model.php:

// If the formo object to validate against doesn't exist, make it
$this->generate_form();

if (!$this->form->validate(TRUE))
    throw new Validator_Exception($this->form->errors(), 'Failed to validate form');

Aquí está mi cambio, no he probado cuidadosamente, ya que sólo estoy empezando a usar la jalea-auth / formo:

if (isset($this->form))
{
    // If the formo object to validate against doesn't exist, make it
    $this->generate_form();

    if (!$this->form->validate(TRUE))
        throw new Validator_Exception($this->form->errors(), 'Failed to validate form');
}

parche: https://github.com/gimpe/kohana-formo- jalea / commit / e95df23ced9647f41f70f18244dc1794ba7c6bc1

Otros consejos

Siempre debe utilizar bloques try...catch() cuando los objetos ahorro de jalea:

try {
    $model->save();
    // object saved successfully
}
catch (Validate_Exception $e)
{
    // get validation errors
    $errors = $e->array->errors();
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top