TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
Forums are in read-only mode while we transition to new software.
[SOLVED] KO 3.2 Kohana Captcha Module issues
  • Hey i am using Kohana Captcha Module with Kohana 3.2 i have a lot of issues in this module with the new Kohana Config Reader.

    Anyone fixed this module yet ?

    Edit: never mind, i fixed it myself.

    Error:

    ErrorException [ Fatal Error ]: Call to undefined method Kohana::config()
    MODPATH/captcha/classes/captcha.php [ 64 ]
    $config = Kohana::config('captcha')->get($group);
    

    Fix:

    $config = Kohana::$config->load('captcha')->get($group);
    

    Error:

    ErrorException [ Fatal Error ]: Call to undefined method Kohana::config()
    MODPATH/captcha/classes/captcha.php [ 98 ]
    if ( ! is_array($config = Kohana::config('captcha')->get($group)))
    

    Fix:

    if ( ! is_array($config = Kohana::$config->load('captcha')->get($group)))
    

    Error:

    MODPATH/captcha/classes/captcha.php [ 106 ]
    if ( ! is_array($default = Kohana::config('captcha')->get('default')))
    

    Fix:

    if ( ! is_array($default = Kohana::$config->load('captcha')->get('default')))
    
  • Don't forget about replace function "image_render" in Captcha.php class. Go to line 437-440 and replace old request header to K3.2 Request: Request::current()->headers('Content-Type', 'image/'.$this->image_type); Request::current()->headers('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); Request::current()->headers('Pragma', 'no-cache'); Request::current()->headers('Connection', 'close');

    Also in MODPATH/captcha/classes/captcha - don't forget about change captcha config load.

    Regards.

  • Also: If you want to use the types 'word' or 'riddle', you need to change "Kohana::config" to "Kohana::$config->load" in both 'MODPATH/classes/captcha/word.php' and 'MODPATH/classes/captcha/riddle.php'.

    (yay - first contribution!)

  • riddle actually is not working, but all ok with words

  • Thanks for great post. Captcha started to work.

  • thanks for kevinPL ,zenlord,davidvandertuijn .captcha works fine.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion