Jump to content
  • 0

Universal Module Input Rules


xison

Question

Hi there,

 

I'm attempting to make-shift an order form for Dedicated Servers utilizing the Universal Module.

 

So far I have it working the way I want, however the input rules do not appear to be working. I am betting I am simply doing it wrong, but it may be a bug, I'm not sure.

 

Anyway, I've created a product under the Universal Module called "Dedicated Server", with the following Service Options:

1) Hostname - Name 'hostname' - Regular Input Box - Required: Yes - Encrypt: No

2) Operating System - Name 'operating_system' - Select Box - Required: Yes - Encrypt: No

3) Special Instructions - Name 'instructions' - Textarea - Required: No - Encrypt: No

 

In the input rules, I have the following, based on the example in the documentation here: http://docs.blesta.com/display/user/Universal+Module

{"hostname":{
    "valid":{
        "rule":"isEmpty",
        "negate":true,
        "message":"You must enter a Hostname."
    }
}}

According to the documentation, it should not allow the 'hostname' parameter to go through if it is empty, but it does on it's merry little way.

 

Am I doing something wrong?

 

Thanks.

Link to comment
Share on other sites

24 answers to this question

Recommended Posts

  • 0

Hi there,

 

I'm attempting to make-shift an order form for Dedicated Servers utilizing the Universal Module.

 

So far I have it working the way I want, however the input rules do not appear to be working. I am betting I am simply doing it wrong, but it may be a bug, I'm not sure.

 

Anyway, I've created a product under the Universal Module called "Dedicated Server", with the following Service Options:

1) Hostname - Name 'hostname' - Regular Input Box - Required: Yes - Encrypt: No

2) Operating System - Name 'operating_system' - Select Box - Required: Yes - Encrypt: No

3) Special Instructions - Name 'instructions' - Textarea - Required: No - Encrypt: No

 

In the input rules, I have the following, based on the example in the documentation here: http://docs.blesta.com/display/user/Universal+Module

{"hostname":{
    "valid":{
        "rule":"isEmpty",
        "negate":true,
        "message":"You must enter a Hostname."
    }
}}

According to the documentation, it should not allow the 'hostname' parameter to go through if it is empty, but it does on it's merry little way.

 

Am I doing something wrong?

 

Thanks.

 

I'm not familiar with this, however try changing hostname to: service_field_1

Link to comment
Share on other sites

  • 0

I don't see anything inherently wrong with the way you've configured this. I think we will need to try to duplicate the issue, to see if we can confirm this as being a bug or not. Has anyone else been able to confirm?

I will do some digging and provide some more info later. I'm not at my desk for a while (almost dinner time, and then family time).

I can tell you I installed the trial on v3.0.0 then upgraded using the v3.0.1 patch.

Link to comment
Share on other sites

  • 0

This bug has not been fixed in 3.0.3. I've encountered it today while adding a product.

 

Universal module service options:

 

Label: Enter your domain

Name: cliententerdomain

Type: text

Required: Yes

Encrypt: Yes

Values: empty

 

Input rule validation:

 

{"cliententerdomain":{
                     "valid":{
                             "rule":"isEmpty","negate":true,"message":"Domain cannot be empty. We wouldn't know how to set up your product correctly."
                             }
                     }
}

 

Additional info:

tried changing the field name (see documentation) to service_field_1, uni_cliententerdomain, uni_service_field_1. (uni_ comes from viewing the source of the page. That's the actual name given to the variable)

 

Did not check this before manually applying the patch for the empty order page (as documented in http://www.blesta.com/forums/index.php?/topic/1086-oh-noes-universal-module/#entry8899). Universal module came up with an upgrade button after applying the patch, clicked upgrade then went on with configuring the product.

 

Input validation should happen as soon as you hit the Continue button, after selecting the package required, to prevent the client having to redo this step at the end of checkout.

 

"Proper" ordering flow: Select package, click select, forget to input domain, click continue, message that the domain is required pops up, client enters domain, click continue, enter customer/payment info.

 

Setting the options as the package options instead of the service options (need to change the text on the page to admin options, client options, it's too confusing as it is now) works OK. The validation happens correctly when trying it from the admin site.

Link to comment
Share on other sites

  • 0

Setting the options as the package options instead of the service options (need to change the text on the page to admin options, client options, it's too confusing as it is now) works OK. The validation happens correctly when trying it from the admin site.

 

Are you saying your input error rule is being validated when adding a service in the admin area, but not when adding a service via an order form?

Link to comment
Share on other sites

  • 0

Your outdated.

 

Not my fault:

Blesta © 2007-2013, Phillips Data, Inc.

Licensed to X

Installed Version 3.0.3

 

Universal module has been upgraded through the web gui (the upgrade button came up instead of the manage button, see my post above). Thought that was supposed to upgrade it.

 

Are you saying your input error rule is being validated when adding a service in the admin area, but not when adding a service via an order form?

Exactly. Adding a rule in the package section, with the input validation, requires me as the admin logged in to enter the hostname when manually editing the package. When "ordering" the product as a client, no validation happens.

Link to comment
Share on other sites

  • 0

Uninstalled the universal module, and when going to modules > available, the version listed is 1.0.8. I think the validation bug is irrelevant, since I cannot upgrade to the latest module version to verify if the bug is fixed or not. As a reminder, my blesta version shows up as 3.0.3

 

 

EDIT:

Manually uploaded public_html/components/modules/universal_module overwritting the files on the server. Version 1.0.9 showed up correctly. Installed, will test and report back.

Link to comment
Share on other sites

  • 0

Nope, 1.0.9 comes with 3.0.3. Taken directly from the unzipped 3.0.3.

 

Success!!! bug is fixed. The domain field is correctly validated, and a message pops up if it is empty. If a domain is written into the box, then it shows up on the next step.

 

Thank you all for your time. Another small step for man, a giant leap for mankind :P

 

EDIT: (trigger happy post)

 

For those in the same situation as me, don't forget to go back to packages>browse and edit all your packages to point to the correct module "thingy" (service). Otherwise nothing happens when you click select on the order form. Assuming this is due to the module being uninstalled. Easy fix.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...