Skip to content

On saving of Pod with multiple fields, use dbDelta #4812

@sc0ttkclark

Description

@sc0ttkclark

Issue Overview

When saving a pod with multiple fields, each field gets added individually. That's OK but they get added to the DB before all fields are properly validated. What we should do is save the fields to the config and then do the dbDelta() at the end of that saving routine so we catch any problems per field that would send back an error.

This prevents cases where you add 2+ fields, save the pod, one of the later fields has an error, and then when you fix that error and save again there's an SQL error that the DB column already exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Keyword: PuntableType: EnhancementEnhancements to features that already exist, but are not major additions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions