Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fResultSet: Fatal error: Exception thrown without a stack frame in Unknown on line 0

posted by audvare 8 years ago
DROP TABLE IF EXISTS polls;
CREATE TABLE polls (
  pid INT PRIMARY KEY AUTO_INCREMENT,
  uid INT UNSIGNED NOT NULL DEFAULT 0,
  question VARCHAR(140) NOT NULL,
  answer_1 VARCHAR(128) NOT NULL,
  answer_2 VARCHAR(128) NOT NULL,
  answer_3 VARCHAR(128) NOT NULL DEFAULT '',
  answer_4 VARCHAR(128) NOT NULL DEFAULT '',
  status INT UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX pid_uid ON polls (pid, uid);
CREATE UNIQUE INDEX uid_question ON polls (uid, question);
class Poll extends fActiveRecord {}
$polls = fRecordSet::build('Poll', array('status=' => 1), 5, 0, 1);

prints Fatal error: Exception thrown without a stack frame in Unknown on line 0

The class-table association is made correctly and I do have it forced regardless with fORM::mapClassToTable().

Take a look at http://flourishlib.com/docs/fRecordSet#Ordering

Here's your code reformatted with some comments

  $polls = fRecordSet::build(
    'Poll',                    //fActiveRecord Class Name
    array('status=' => 1),     //Where Clause (where status=1)
    5,                         //Order By Clause (5?)  <-- ERROR
    0,                         //Limit 
    1);                        //Offset

Take a look at the API for fRecordSet::build() and you will see that the third parameter is the $order_bys array.

I believe changing your code to this:

  $polls = fRecordSet::build('Poll', array('status=' => 1));

Would work.

I agree though that the error message isn't very helpful.

posted by ihumanable 8 years ago

Unfortunately the error message is outside of Flourish's control. I believe when you see the error "Exception thrown without a stack frame" usually indicates that an exception is being thrown during script shutdown, such as in the destructor of an object. The most likely culprit in Flourish would be using fTemplating::buffer().

posted by wbond 8 years ago