Custom fields always required

This topic contains 2 replies, has 3 voices, and was last updated by  Kiran 5 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #443614

    Louis
    Expired Member
    Post count: 28

    I’ve added a price field to my events which i’ve set as not required. When posting via the API I’m getting the message:

    
    
        "code": "rest_invalid_param",
        "message": "Invalid parameter(s): geodir_minPrice",
        "data": {
            "status": 400,
            "params": {
                "geodir_minPrice": "geodir_minPrice is not of type number."
            }
        }

    This should be ignored as it’s not required – please you investigate and advise?

    #443673

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #443684

    Kiran
    Moderator
    Post count: 7069

    Hi Louis,

    In rest api it validates field value type for number if field type is chosen to number in field settings, so if it founds non number then it raises error.
    Use default value as 0 in GeoDirectory > CPT Settings > Custom Fields > geodir_minPrice.

    Kiran

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket