"Yes/No" type "Custom Field" doesn't seem to be working

Hello,

I am trying to create a conditional Yes/No custom field to use with my Nginx hack (issue https://www.virtualmin.com/node/45023 ), but I am noticing that the variable doesn't have a value when declared, regardless of whether Yes or No is used.

Eg I created a custom field called NginxStaticCaching of type Yes/No, default No. When the prepost hook script executes I can see there is a VIRTUALSERVER_FIELD_NGINXSTATICCACHING declared, but no value.

In fact, after the creation I tried to switch it from No to Yes in Edit Virtual Server, but when the page refreshes it still shows "No" as the chosen one.

Any ideas what's wrong?

Status: 
Closed (fixed)

Comments

Which Virtualmin version are you running there? Because I recall that there used to be a bug that caused this problem, but we fixed it in the latest (5.05) release.

Jamie,

I'm on 5.05, this is a stock installation, just a few days old, for testing nginx and stuff. Nothing fancy,

Can you attach a screenshot of exactly what you entered on the Custom Fields page? I'd like to see how you have it setup..

You need to enter something into the field to the right of the menu in which Yes/No is selected - that's the value that the variable will have when "Yes" is selected.

Ohh, thought it was a simple boolean... Thanks, that seems to have fixed it.

Happy new year!

Status: Active ยป Fixed