The odd bit

Once is an accident, twice is a coincidence, three times is an enemy action.

The odd bit - Once is an accident, twice is a coincidence, three times is an enemy action.

Regular Expression Datatype: Planned Update

A recent comment to my regexp datatype contribution reminded me of an irritating shortcoming in eZ publish. It’s not possible for datatypes to send error messages back into the class edit. It’s only implemented on the object level for some bizarre and obscure reason.

I plan to incorporate class-level error messages in the next release of the datatype (expect the release soonish) but it’s a real shame that this shortcoming has survived 8 releases so far.

But for now, back to C# πŸ˜‰

  • Paul Borgermans says:

    Hi Hans

    Class level input validation for the abstract class is supported for quite a while (3 years, roughly ). It is up to the specific datatype to implement it. So what do you mean by “ItÒ€ℒs not possible for datatypes to send error messages back into the class edit”?

    Paul

    24 July 2006 at 19:45
  • Hans Melis says:

    Hi Paul

    I mean exactly what I wrote :)

    Of course class validation is supported. That’s what the whole validateClassAttributeHTTPInput() function is about. What I mean is that it’s not possible to set error messages in the same way that you do on the object level.

    Object attributes have a method setValidationError() which takes a text as parameter. The text you supply is the error message the user will see in object edit (after the name of the attribute).

    Class attributes have no such method. If you signal the invalid state in the datatype, the class edit screen will say something like this:
    “Validation failed:
    – Title (id: 305)”.
    A bit of a challenge for a user to know what’s wrong πŸ˜‰

    25 July 2006 at 16:03
  • Paul Borgermans says:

    OK, should read better πŸ˜‰

    That’s indeed a serious shortcoming, especially for such swiss knife extensions as your regexp datatype.

    Happy C# programming

    25 July 2006 at 19:13

Your email address will not be published. Required fields are marked *

*