We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Fieldtype validate

Developer Preview

NicoDG's avatar
NicoDG
26 posts
10 years ago
NicoDG's avatar NicoDG

Hi,

Seems like the fieldtype validate function isn’t being called when publishing an new entry. When updating an entry it works fine. I tested it by returning an error by default. It only seems the case with third party fieldtypes.

       
Seth Barber's avatar
Seth Barber
172 posts
10 years ago
Seth Barber's avatar Seth Barber

We’ve not yet been able to reproduce on this end. Which third party fieldtype were you testing with?

       
NicoDG's avatar
NicoDG
26 posts
10 years ago
NicoDG's avatar NicoDG

In EE2.x the validate function was being called even if the field wasn’t required and the function returned TRUE if the data was empty. In the new version, it seems that validate isn’t being called when the value is empty

Example, taken from the text fieldtype:

function validate($data)
 {

  if ($data == '')
  {
   return TRUE;
  }
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.