0

I have some code, where is used Form helper. All worked well. Now I have error

Call to undefined method Form::open()

When I check SYSPATH exist classes Form and Kohana_Form

This situation is in each file where is used this helper.

This is kohana 3.2. In this files was not any changes. I tried it on PHP 5.4 and PHP 5.5

Any idea why? Thanks in advance for help.

Sougata Bose
  • 31,517
  • 8
  • 49
  • 87
110precent
  • 322
  • 4
  • 19
  • The same situation is with every element from Form helper. I trough that reason is using git to download kohana core and modules, but it not work also on server where was upload full code without use git. – 110precent Sep 15 '14 at 09:17
  • Are you in a namespace when you're trying to call it? – Joe Sep 15 '14 at 09:25
  • No I don't use namespaces in this project. It's not my project. It worked in past (1 week ago). Now I see that problem is with `Form` class. Because `Kohana_Form` works well. But I can't change it, to many views to change. – 110precent Sep 15 '14 at 09:30
  • Do you have a `Form.php` in `application_public/helpers` (or whatever your application folder is)? If so, this overrides `Kohana_Form`, and if it doesn't extend `Kohana_Form` it'll bork out there – Joe Sep 15 '14 at 09:31
  • In my application folder are only controllers and models. Any file have not Form.php name. – 110precent Sep 15 '14 at 09:35
  • You should have in your system folder file named form.php with class Form extends Kohana_Form {}, in system/kohana you should also have form.php with class Kohana_Form and static method open(). If something is missing then someone deleted/changed it. If it exist and is in same format as I wrote, then double confirm your SYSPATH variable if for sure it is using this system folder that you are checking – Grzesiek Sep 15 '14 at 15:10

1 Answers1

0

The most likely thing is that you have a Form.php somewhere that's overriding the SYSTEM Form.php. To find out if this is happening, use the Kohana::find_file() function like this:

Kohana::find_file('classes', 'form');

The output from this should tell you the path of the Form.php that's being used when you call the Form class. Check if it's the one in the SYSTEM folder.

lukenofurther
  • 543
  • 4
  • 8