Ticket #430 (closed Bug: fixed)

Opened 6 months ago

Last modified 2 months ago

Forge_Core error handling of classes (real issue not fixed)

Reported by: xadio Assigned to: Shadowhand
Priority: blocker Milestone: 2.1.2
Component: Modules:Forge Version: SVN HEAD
Keywords: Forge invalid unknown input Cc:
SVN Revision (if applicable):

Description

In reference to t408

I believe this change r2123 was a partial fix, but not a complete one. This happened because of how I described the problem.

The problem still occurs when the following is used

$forge = new Forge(NULL, 'Some Form');
$forge->unknownFunction();

The error will still be blank because an unknown input has no class defined ie Unable to find a Forge input class for: ________

If one looks in the stack they will be able to diagnose their problem, but a very easy fix is to either

if ( ! ($input instanceof Form_Input) AND ! ($input instanceof Forge))
-      throw new Kohana_Exception('forge.unknown_input', get_class($input));
+      throw new Kohana_Exception('forge.unknown_input', $input);

or

if ( ! ($input instanceof Form_Input) AND ! ($input instanceof Forge))
-      throw new Kohana_Exception('forge.invalid_input', get_class($input));
+     if ( ! empty(get_class($input)))
+           throw new Kohana_Exception('forge.unknown_input', get_class($input));
+     else 
+           throw new Kohana_Exception('forge.unknown_input', $input);

Change History

02/22/08 15:06:00 changed by xadio

Refer to t431 which is in relation to this.

02/24/08 11:46:30 changed by Shadowhand

  • status changed from new to assigned.
  • milestone changed from 2.2 to 2.1.2.

02/24/08 11:58:03 changed by Shadowhand

  • priority changed from minor to blocker.

05/28/08 17:46:03 changed by Shadowhand

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r2699, merged in r2700.