Since no one was answering to [url=http://www.silverstripe.com/google-summer-of-code-forum/flat/2572]my post in the GSoC forum[/url] I'll try it here :-)
For OpenID support I implemented a DataObjectDecorator, but I couldn't figure out how I can add a custom validator to it. I need to ensure that the entered OpenID is unique so that only one user account is linked to a specific OpenID. Is that somehow possible?
At the moment I prevent duplicate OpenIDs by using a unique-index, but no error message will be shown.
Is there any way to implement a validator for DataObjectDecorators or handle such database errors ("Duplicate entry 'http://markus-lanthaler.myopenid.com/' for key 2")?
This would help me a lot to complete OpenID support!
Not sure whether you're looking for a similar solution but thought this would shed some light ;)
I saw in [url=http://open.silverstripe.com/browser/modules/forum/trunk/code/ForumRole.php"] ForumRole.php[/url], implemented a ForumMember validator extending Member_Validator and overriding the getValidator function inside ForumRole.
Similarly can't you extend the Member_Validator and add php() function with necessary validation which is to executed server-side ?
> I saw in ForumRole.php, implemented a ForumMember validator extending
> Member_Validator and overriding the getValidator function inside ForumRole.
> Similarly can't you extend the Member_Validator and add php() function with necessary
> validation which is to executed server-side ?
That was also my first thought and so I tried that already but unfortunately that is code that isn't executed at all.
It doesn't do anything in the ForumRole so that code is also buggy..
I forgot to post a bug report about that to the bugs forum (will do that now).
Edit: I [url=http://www.silverstripe.com/bugs/flat/3561]posted it to the bugs forum[/url] and created a [url=http://open.silverstripe.com/ticket/1401]ticket[/url].