Support

Account

Forum Replies Created

  • As I wrote in my first post, I use my wordpress instalation in a non-standard way. It’s used because it provides a great amount of useful functions + admin interface, but on the frontent I have my custom .php files which load wordpress with the SHORTINIT param. And I have also my custom database queries to get the ACF fields, because the plugins are not loaded on SHORTINIT. As I wrote I need to pass the fields as an object to ajax response, to have it in my frontend javascript, so I create an object of fields, $obj->field_name = 'field_value'. If there was an empty field without name, without label, it caused error because of trying to create an object property with empty name

    $prop_name = null;
    $obj->$prop_name = $field_val; // error!

    Of course, I can just check if the field name is not empty, but I think it should be done during saving a field, because I’m sure no one needs a field without name, but one can create it ‘by accident’.

    Just for rules, logically when the field is marked as required, and it really is required, it should be required.

    Please consider adding this one or two lines of code, in the next version 🙂

  • Thanks for your replay.

    This doesn’t make any sense to me also, to create a field with empty label and name. But, there is a theory that any software should be just ‘idiotproof’… So one should not be able to do something like that. Personally I just created an empty field by accident, it saved and broken my site.
    It is some kind of a standard in such a software, that the inputs are validated, because the user can really be ‘stupid’ or just overlook something. And, as I wrote, both fields are marked as required. But they are not in fact.

    So, again, I think it should done in the core of the plugin as there are two lines of code needed to check if the value is empty. And to create an empty name if the label is filled there are built-in functions in wordpress (‘sanitize_title’ ? ). I don’t really understand, why you don’t think it should be fixed?

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)