Bug Report: rev145: Attempting to edit a validation or Save/Apply a new one.

tek

Member
Upon clicking in the form validations and selecting any record, when attempting to save, or apply either during a edit or the creation of a new rule i get the following error message.


Code:
fabrikValidation Object
(
  [id] => 3
  [element_id] => 82
  [validation_rule_id] => 1
  [message] => 
  [clent_side_validation] => 0
  [checked_out] => 
  [checked_out_time] => 
  [_tbl] => #__fabrik_validations
  [_tbl_key] => id
  [_error] => 
  [_db] => database Object
    (
      [_sql] => SELECT COUNT( session_id )
 FROM jos_session
 WHERE session_id = '0a6940387f2e487a8230af3dfe89d54f'
 AND username = 'admin'
 AND userid = 62
      [_errorNum] => 0
      [_errorMsg] => 
      [_table_prefix] => jos_
      [_resource] => Resource id #12
      [_cursor] => Resource id #16
      [_debug] => 0
      [_limit] => 0
      [_offset] => 0
      [_ticker] => 0
      [_log] => Array
        (
        )

      [_nullDate] => 0000-00-00 00:00:00
      [_nameQuote] => `
    )

)
 
I'm getting the same problem. Joomla 1.0.13. Fabrik 1.0.4. I REALLY need a way to validate fields. Is there a fix or alternative solution to this problem?
 
Update: I CAN create validations directly from the elements (sigh of relief). It's only when I click on "Validations" on the Fabrik "header" links and try to create a validation rule that I get the raw PHP code problem above.
 
It looks like Rob was in the middle of debugging something. That stuff is being printed by a debug line, that then exits the script.

I've had a quick look, and it seems like the validation was being stored with the wrong element ID, which is probably why he was debugging. I'll get this fixed.

As you mentioned, the workaround is simply to attach the rule directly from the Element page.

-- hugh
 
I was having problems with ALL of my forms returning mysql errors after I had entered more than about 6 records in the validations table. So I cracked the DB open with PHPMyAdmin and noticed that one of the jos_fabrik_validations table columns was named "clent_side_validation". I renamed it to "client_side_validation", deleted all my validations, and restarted creating them. Now maybe it's late and I'm delirious, but I've entered like 30 validations now and it's still rock solid. Was that a good thing to do?
 
That's weird, because there is no such built in validation as 'client_side_validation', so it must be something you added, unless this is a hangover from an earlier version I'm unaware of. Which could easily be the case, as I only started using Fabrik at 1.04.

-- hugh
 
I didn't start using Fabrik until v1.0.4 either. I didn't add it myself, it's a column that's in the jos_fabrik_validations mysql table. I don't see any options for it from the administrator interface, so maybe it was planned for something that never happened. All I know is that when I "fixed" the typo, my validations started working flawlessly. Although I still can't add one from the "Validations" page of Fabrik. Where do I find those latest SVN revs?
 
As another example that I didn't add that column, Timothy Tuck's original post in this thread has the same typo and references the same column.
 
Sorry, I misunderstood your first mention of that typo. I thought you had a row in the table by that name, but of course you mean the column name.

Yes, it's an unused feature. And as far as I can tell, it will have had nothing to do with problems with your validation rules.

The typo in the db schema is actually matched by the PHP. In the main fabrik_validations.class.php, it's a class var:

/** @var bol client (true) or server(false) side valitaion */
var $clent_side_validation = 0;

When new rules are created, the code simply does a 'bind' of the new db table row to the posted values from the form on the validation admin page. As 'clent_side_validation' is not referenced on the form (it never got implemented in 1.04), it just defaults to 0.

So changing the name in the db has zero effect on the code. I've searched thoroughly (for both spellings). In fact, all this might do is break client side validation if it ever gets added in 1.04 (which I doubt it will, tho it should be in 2.0).

I suspect things started working again because by zapping the rules and starting again, you somehow fixed some lurking problem in the db data.

Re SVN. Short answer is, point an svn client at http://joomlacode.org/svn/fabrik, and grab the 1.04 trunk. Let me know if you need more details. I need to put a simple "how to" sticky post in the support forum anyway.

-- hugh
 
Back
Top