Add Event Title Filled

Home Forums Calendar Products Community Events Add Event Title Filled

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #988499
    Cappy
    Participant

    Ok, I am stumped again. When I click on add events from the front end, the title is prefilled with “Nov 30, -0001” I tried different accounts, and still the same. It is template related as it doesn’t show on 2015, but I can’t figure out what would cause this.

    Thank you!

    Screen Shot

    <!--
    
     Event Title 
    
    -->
    
    <div class="events-community-post-title">
    
        <label class="" for="post_title"></label>
    
    <input type="text" value="Nov 30, -0001" name="post_title"></input>
    
    </div>
    #988591
    Geoff
    Member

    Hey there, Cappy!

    Oh man, that’s definitely not good–sorry for the trouble here.

    It’s honestly really hard for us to troubleshoot this sort of thing because it seems directly related to the theme and we’re not exactly sure how the theme was written or built. Would it be possible to reach out to the theme author in this case to see if that gives us a start we can use to troubleshoot further?

    Cheers!
    Geoff

    #988899
    Cappy
    Participant

    Hi Geoff,

    Can you tell me what file to look in to find the string that searches for the information to fill that value?

    Thank you!

    Cappy

    #989077
    Geoff
    Member

    Sure! The template where you can find that call is in the Community Events plugin directory under: /views/community/edit-event.php.

    This should what to look for:

    <div class="events-community-post-title">
    <?php tribe_community_events_field_label( 'post_title', sprintf( __('%s Title:', 'tribe-events-community'), $events_label_singular ) ); ?>
    <?php tribe_community_events_form_title(); ?>
    </div><!-- .events-community-post-title -->

    Cheers!
    Geoff

    #989761
    Cappy
    Participant

    Hi Geoff,

    I am completely baffled. I can’t even find Nov 30, -0001 anywhere in the database or the files, so I can’t figure where it might be getting that text from. Do you have any ideas what might cause this?

    Thank you,

    Cappy

    #989922
    Geoff
    Member

    Hi Cappy,

    That string may not be contained in the database itself, but generated dynamically by a called function.

    Unfortunately, I think this is something the theme author would be better suited to answer. Let me know if any questions come up from the author that we can help answer and I’d be happy to help as best I can.

    Thanks,
    Geoff

    #991400
    Cappy
    Participant

    Hi Geoff,

    I hired someone to fix the issue, and he said he found the error in the plugin, not the theme. Here is what he changed. Can you confirm this as an error, or will what he changed cause an issue? Thank you!

    [7/29/15, 8:23:13 AM] Richestsoft: public function formTitle( $event = null ) {
    $title = get_the_title( $event );
    if ( empty( $title ) && ! empty( $_POST[‘post_title’] ) ) {
    $title = stripslashes( $_POST[‘post_title’] );
    }

    ?>
    <input type=”text” name=”post_title” value=”<?php esc_attr_e( $title ); ?>”/>
    <?php
    }

    to

    public function formTitle( $event = null ) {
    if(!empty($event))
    {
    $title = get_the_title( $event );
    }
    if ( empty( $title ) && ! empty( $_POST[‘post_title’] ) ) {
    $title = stripslashes( $_POST[‘post_title’] );
    }

    ?>
    <input type=”text” name=”post_title” value=”<?php esc_attr_e( $title ); ?>”/>
    <?php
    }

    /the-events-calendar-community-events/src/Tribe/Main.php

    public function formTitle( $event = null ) {
        $title = get_the_title( $event ); 
       if ( empty( $title ) && ! empty( $_POST['post_title'] ) ) {
        $title = stripslashes( $_POST['post_title'] );
       }
       
       ?>
       <input type="text" name="post_title" value="<?php esc_attr_e( $title ); ?>"/>
       <?php
      }
    
    to
    
    public function formTitle( $event = null ) {
       if(!empty($event))
       {
        $title = get_the_title( $event ); 
       }
       if ( empty( $title ) && ! empty( $_POST['post_title'] ) ) {
        $title = stripslashes( $_POST['post_title'] );
       }
       
       ?>
       <input type="text" name="post_title" value="<?php esc_attr_e( $title ); ?>"/>
       <?php
      }
    #991424
    Geoff
    Member

    Hey there, Cappy!

    Thanks for the heads up. The template does use get_the_title() here, which is something we’ve used for quite some time and typically returns and empty string on non-posts. I’m super glad that the changes you made fix this specific case where the WP filter the_title is returning a value where it probably should not.

    Your solution should not cause an issue for you at all. Just be sure to carry the change forward if and when the plugins update so the work is not lost.

    Cheers!
    Geoff

    #991498
    Cappy
    Participant

    Thanks Geoff! I will make sure to keep the changes handy in case of updates.

    Cheers!

    Cappy

    #991571
    Geoff
    Member

    My pleasure! Happy to be of service and cheers to you as well. 🙂

    Geoff

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add Event Title Filled’ is closed to new replies.