load_ecp_title_into_page_template Error

Home Forums Calendar Products Events Calendar PRO load_ecp_title_into_page_template Error

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #29994
    Sean
    Participant

    i am getting
    Warning: Missing argument 2 for TribeEventsTemplates::load_ecp_title_into_page_template() in /home/newlife9/public_html/dev/wp-content/plugins/the-events-calendar/lib/tribe-templates.class.php on line 142
    i do not get the error in the Twenty Twelve theme so i assume something is missing from my theme, i did notice if i change line 142 in /the-events-calendar/lib/tribe-templates.class.php
    from
    public static function load_ecp_title_into_page_template($title, $id)
    to
    public static function load_ecp_title_into_page_template($title)
    the error goes away but i dont want to edit core files if i can help it.

    any advice would be appreciated.

    Sean

    #30000
    Barry
    Member

    Hi Sean – is there any further detail you can provide here (any other information being reported as part of the error for instance)?

    TribeEventsTemplates::load_ecp_into_page_template() serves as a filter for the_title and as I understand things it is required to accept two parameters, $title and $id.

    If we could figure out what piece of code is calling it that would be great. If you need any further clarification at all, please just let me know and I’d be happy to help 🙂

    #30006
    Sean
    Participant

    beyond the error given above, i dont have any other errors, the same error appears in the error log.
    i only see the error on pages related to the events calendar
    http://dev.newlife919.com/events/
    http://dev.newlife919.com/event/woman-to-woman-community-bible-study/
    i does seem to be related to the image slider above the content

    Roster Slider


    if i disable this plugin the error goes away but i have no idea why this would conflict with the ID?

    #30007
    Sean
    Participant

    looking back at a few revisions it seems that 2.0.3

    public static function load_ecp_title_into_page_template($title) {

    global $post;
    if (is_single() && !tribe_is_showing_all()) {
    return $title;
    } else {
    return tribe_get_events_title();
    }
    }

    and at some point it changed to

    public static function load_ecp_title_into_page_template($title, $id) {
    global $post;
    return ( !is_single() && (isset($post->ID) && $post->ID == $id) ) ? tribe_get_events_title() : $title;
    }

    the earlier revision of the function seems to work with out the error

    #30022
    Barry
    Member

    I would need to look at the slider code to determine this, but if this only happens when that plugin is active then it suggests it is triggering the the_title filter – but perhaps is not passing all of the parameters usually expected.

    The definition of TribeEventsTemplates::load_ecp_into_page_template() may well have changed since earlier versions and I can’t see anything “wrong” with those changes, it all seems in order. It requires two parameters and that is declared when it is registered as a filter … so I can’t help but wonder if your slider is doing something atypical here.

    Is using an alternative slider a possible solution here? If not, perhaps you could email a copy of it across (to [email protected], marking the email for my attention and including a link back to this thread) – I could then take a look for myself.

    #30107
    Barry
    Member

    I’m not seeing this problem; would I need to have something other than Twenty Twelve active in addition to using Roster Slider?

    #30123
    Sean
    Participant

    as i said initially, “i do not get the error in the Twenty Twelve theme so i assume something is missing from my theme” would you like me to send you the theme?

    #30128
    Barry
    Member

    Yep I noticed that, I just wanted to be clear that the blame hasn’t shifted from that to your Roster plugin, as it were. Yes please send the theme across and I’ll take a look at that.

    Certainly nothing looked untoward with the the_title calls in the plugin.

    #30179
    Barry
    Member

    Thanks for sending the theme over.

    I still can’t replicate this, I’m afraid, even with the Default Page Template selected. There are numerous other notices (minor errors) being emitted due to code in both the theme and slider plugin, but I’m not seeing quite the error you have described above.

    Is there anything I would need to put in place, perhaps in terms of configuring and deploying the slider, to see this?

    Can you also provide a way for me to observe your dev site?

    #30190
    Sean
    Participant

    the other errors are probably related to an XML file you would not have in your install, i have sent you full access to the dev site. i keep it protected to prevent confusion for visitors and the client.

    #30196
    Barry
    Member

    Sean:

    I’ve taken a look and it looks like the problem is centred on one of two things. Firstly, in your version of the Roster plugin, there is a function called roster_global_posts_processor() – this contains a loop which, on its first iteration, tries to pass a Post ID using a variable that isn’t defined until the second iteration. So that ties in with the error we are seeing, but doesn’t really explain the subsequent errors in itself.

    The second thing I noticed is that there is a filter called roster_post_title and something is probably happening downstream from there to cause the other instances of the error.

    Strangely enough, the version of the Roster plugin you sent to me doesn’t contain that function (roster_global_posts_processor()) nor does it or the copy of your theme that you sent across contain any references to the roster_post_title filter, which might explain why I couldn’t replicate this.

    Perhaps you are using different versions or are actively modifying those bits of code?

    #30198
    Barry
    Member

    To amplify, here’s an annotated segment of code from roster_global_posts_processor().

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘load_ecp_title_into_page_template Error’ is closed to new replies.