Support » Plugin: Events Manager » LATT aren’t processed?

  • Resolved andermurks

    (@andermurks)



    I’ve added a #_LATT{Testname}{option1|option2} to Location custom attributes and enabled custom Location attributes. I have placed the #_LATT{Testname} in the Location format settings.
    However, any valid #_LATT doesn’t seem to appear, it will just get (presumably) substituted by an empty string.
    Is there something else I could be doing wrong or is it really a bug?

Viewing 6 replies - 1 through 6 (of 6 total)
  • aprilschmitt27

    (@aprilschmitt27)

    I’m not sure if this is related, but under EM v5.9.4, my “Location Attributes” (including #_LATT{Latitude} and #_LATT{Longitude}) were not displaying anywhere except in the database. When I rolled the version back to v5.9.2 …is works normally. Thanks for this fabulous plugin!

    andermurks

    (@andermurks)

    That’s good to know, thanks. Unfortunately, I’ve only installed EM recently and have no older version available. Do you know where I could find a v5.9.2 download?

    andermurks

    (@andermurks)

    I’ve found the problem.
    In em-location.php on line 205-219 there was a change from 5.9.2 which rendered #_LATT into empty strings.
    Code in question:

    // old code
    foreach($location_meta as $location_meta_key => $location_meta_val){
    					$found = false;
    					foreach($this->fields as $field_name => $field_info){
    						if( $location_meta_key == '_'.$field_name){
    							$this->$field_name = $location_meta_val[0];
    							$found = true;
    						}
    					}
    					if(!$found && $location_meta_key[0] != '_'){
    						$this->location_attributes[$location_meta_key] = ( is_array($location_meta_val) ) ? $location_meta_val[0]:$location_meta_val;
    					}
    				}
    
    // new code (which doesnt work)
    foreach($location_meta as $location_meta_key => $location_meta_val){
    					$field_name = substr($location_meta_key, 1);
    					if($location_meta_key[0] != '_'){
    						$this->event_attributes[$location_meta_key] = ( is_array($location_meta_val) ) ? $location_meta_val[0]:$location_meta_val;
    					}elseif( is_string($field_name) && !in_array($field_name, $this->post_fields) ){
    						if( array_key_exists($field_name, $this->fields) ){
    							$this->$field_name = $location_meta_val[0];
    						}elseif( in_array($field_name, array('owner_name','owner_anonymous','owner_email')) ){
    							$this->$field_name = $location_meta_val[0];
    						}
    					}
    				}	

    I’ve simply replaced the relevant lines in the 5.9.4 em-locations-php and it works.

    aprilschmitt27

    (@aprilschmitt27)

    Thanks for finding this code error. Hopefully it will be included in the next version, so all “Location Attributes” display with EM v5.9.4. I don’t know if this is the best way, but I backed up and used a plugin called: “WP Rollback”. The EM site probably has a link to do this too.

    Plugin Author Marcus

    (@netweblogic)

    Hi Everyone, this issue has been fixed in the latest dev version and will be out in the next update too.

    You can easily try update to the dev version with a few clicks, see here for instructions – http://wp-events-plugin.com/documentation/upgrade-dev-version/

    Thank you Marcus!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.