- Posts: 9
- Thank you received: 0
Server-side validator
- CLAW Corp
- Topic Author
- Offline
- New Member
-
Less
More
4 years 7 months ago #137963
by CLAW Corp
Server-side validator was created by CLAW Corp
Running: Joomla 3.9.21, PHP 7.4, EB 3.11.3 (nothing in change log seems to indicate a change to validation, will upgrade asap)
Has anyone managed to get server-side validation to work? I've been trying a simple test:
Put "validator.php" into components/com_eventbooking/helper (per eventbookingdoc.joomservices.com/basic-s...eld-data-server-side ). For the test, I want it to always fail:
I've added "hotel_rule" to the "Server Validation Rules" within the custom field's configuration.
I've put logging in RADForm::validate(), but I can't see any evidence this function is ever called to set up the validation nor do I see any logging within the rule above. validate() the only piece of code that explicitly included validator.php. I've verified the filename, too!
I've got my required validation working with JavaScript that I've added into cart.php & register.php, but I'd rather not have to manage patches to these files.
Has anyone managed to get server-side validation to work? I've been trying a simple test:
Put "validator.php" into components/com_eventbooking/helper (per eventbookingdoc.joomservices.com/basic-s...eld-data-server-side ). For the test, I want it to always fail:
Code:
<?php
/**
* @package Joomla
* @subpackage Event Booking
*/
defined('_JEXEC') or die;
Valitron\Validator::addRule('hotel_rule', function($field, $value, array $params, array $fields) {
error_log($field);
error_log($value);
error_log(print_r($params, true));
error_log(print_r($fields, true));
return false;
}, 'Error.');
I've added "hotel_rule" to the "Server Validation Rules" within the custom field's configuration.
I've put logging in RADForm::validate(), but I can't see any evidence this function is ever called to set up the validation nor do I see any logging within the rule above. validate() the only piece of code that explicitly included validator.php. I've verified the filename, too!
Code:
ls -l components/com_eventbooking/helper/validator.php
Sep 20 07:14 components/com_eventbooking/helper/validator.php
I've got my required validation working with JavaScript that I've added into cart.php & register.php, but I'd rather not have to manage patches to these files.
Please Log in or Create an account to join the conversation.
- Jon Anderson
- Offline
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
4 years 3 months ago #140692
by Jon Anderson
Replied by Jon Anderson on topic Server-side validator
I can't get this to work either. Can anyone help?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
4 years 3 months ago #140703
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Server-side validator
Hello Jon
You can submit a support ticket sending us:
- Super admin account
- Link to the registration form
- Tell me ID of the custom field which you setup this server validation rules
I will check to see why it is not executed and guide you to correct it
Regards,
Tuan
You can submit a support ticket sending us:
- Super admin account
- Link to the registration form
- Tell me ID of the custom field which you setup this server validation rules
I will check to see why it is not executed and guide you to correct it
Regards,
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.