0

I have a class Question inherited from fActiveRecord.

When I try to run the following code:

$question = new Question();
$question->setQuestion($_question)->setUseruid($useruid)->setOriginuid($originuid)->setStatus(0)->setAnonymous($anonymous)->store();

the system throws an exception (I am sharing only the message, not the stack trace):

Answer: Please enter a value

Now, I have tried to give a value to that answer field, as follows:

$question = new Question();
$question->setQuestion($_question)->setUseruid($useruid)->setOriginuid($originuid)->setStatus(0)->setAnonymous($anonymous)->store();

but I have no luck, I get the same error.

answer is a not null longtext field in the mysql database table questions. It is able to hold the '' value, but it seems impossible to store empty string as the value of a not-null field using flourishlib. Is this a bug or am I missing something? Is there a work-around?

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175

1 Answers1

0

Flourish converts empty string to null, which is a BUG in my opinion and a really big one. This BUG made me unable to insert a new record using flourish into the given table and I had to use alternative means to achieve my goal. This should be fixed ASAP in my opinion. The picture below illustrates my claim.

flourish documentation

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175