• Resolved Ajay Kumar

    (@smruti123)


    Resolved,
    Problem was with PHP Version ,

    Please Go to file: classes/em_ticket.php

    This code is for PHP 5.X
    function validate(){
    $missing_fields = Array ();
    $this->errors = array();
    foreach ( $this->required_fields as $field ) {
    if ( $this->$true_field == “”) {
    $missing_fields[] = $field;
    }
    }
    if( !empty($this->ticket_price) && !is_numeric($this->ticket_price) ){
    $this->add_error(__(‘Please enter a valid ticket price e.g. 10.50 (no currency signs)’,’dbem’));
    }
    if ( count($missing_fields) > 0){
    // TODO Create friendly equivelant names for missing fields notice in validation
    $this->errors[] = __ ( ‘Missing fields: ‘ ) . implode ( “, “, $missing_fields ) . “. “;
    }
    return apply_filters(’em_ticket_validate’, count($this->errors) == 0, $this );
    }

    replace this function with

    Code PHP 7.X
    function validate(){
    $missing_fields = Array ();
    $this->errors = array();
    foreach ( $this->required_fields as $field ) {
    if ( $this->$field == “”) {
    $missing_fields[] = $field;
    }
    }
    if( !empty($this->ticket_price) && !is_numeric($this->ticket_price) ){
    $this->add_error(__(‘Please enter a valid ticket price e.g. 10.50 (no currency signs)’,’dbem’));
    }
    if ( count($missing_fields) > 0){
    // TODO Create friendly equivelant names for missing fields notice in validation
    $this->errors[] = __ ( ‘Missing fields: ‘ ) . implode ( “, “, $missing_fields ) . “. “;
    }
    return apply_filters(’em_ticket_validate’, count($this->errors) == 0, $this );
    }
    When creating a new event i get this error message
    Missing fields: ticket_name.

    • This topic was modified 7 years, 6 months ago by Ajay Kumar.
    • This topic was modified 7 years, 6 months ago by Ajay Kumar.
  • The topic ‘Missing fields: ticket_name.’ is closed to new replies.