Support

Account

Home Forums Backend Issues (wp-admin) Error on gallery validation logic

Solving

Error on gallery validation logic

  • If i set a gallery custom field to have at least 2 images AND set it as “not required” when i create a post adding no images to the gallery it will say i need to add at least 2 images.

    The logic is flawed here imo. If i choose not to make it required then it should let me post even with 0 images.

    The image minimum requirement cannot be more important than the “required” option, else what is the point of the required option? Might as well not have it.

  • It does appear to be a bug except that the required setting is a default field that is included on all field types. There are several fields where the required setting has no effect on validation, in some cases other field settings will override this.

    For example, you cannot create a select field that is “Not Required” and “Does not allow Null”, or you’ll get the same request. The field is required because it does not allow null.

  • I think the required switch shouldn’t be overridden by anything.
    I mean that’s the whole point 1 switch to decide if the field is required or not.

    The way you have it now it’s a worthless, I can’t choose to have a gallery as “not required” and a minimum of pictures for those who decide to use it.

    i have to set it as “Not required” and also set the minimum to 0. Else it will not validate. See the issue? I just lost control of the minimum images number.

    And useful button should behave like this:

    -> Is the field required?
    -NO: Validate.
    -YES: Are images in min-max range? (+other checks)
    -YES: Validate.
    -No: Don’t validate.

    That overriding is wrong. If you want to make it required, flip the switch to ON. Don’t deny control to the rest of the users.

  • The build in validation filters work the same way as the ones that you can add https://www.advancedcustomfields.com/resources/acf-validate_value/

    If any filter fails then the field will not validate.

    What you’re proposing would mean than if any validation passes to allow the validation, even if something else fails.

    If you want you can submit this as a bug by opening up a new support ticket https://support.advancedcustomfields.com/new-ticket/

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

The topic ‘Error on gallery validation logic’ is closed to new replies.