I am trying to do a custom validation over link field in Drupal CCk. I am currently using Link Contributed module. So in my hook_nodeapi and case validate Notice that this value accept unlimited values this there is a foreach.
case 'validate':
if ($node->type == 'flow')
{
foreach ($node->field_post_twitter as $twitter_v)
{
$pattern = '/(http|https|ftp):[\/]{2}twitter\.com/i';
if (preg_match_all($pattern, $twitter_v['url']))
{
form_set_error('not working');
}
}
}
break;
But its not validating, while if i put it in a normal php file it DOES work. Any ideas of what am i missing ?
Thanks
dvm()and such helpers provided by devel module. "From high-to-low" means: check if the module is loaded at all, then if the function is called, then if your foreach runs and so on. - berkes