• Widget Builder, when activated, shows duplicates of a given event created through both All-in-One event calendar and Events Manager plugins. The event is shown in the “page” of the event, and it is duplicated in the right sidebar where the widgets should be displayed. I deactivated all plugins and turned one on at a time, and it was Widget Builder that was causing the duplicate showing of the events.

    Is there an easy fix for this?

    Thank you,

    Rory Foster

    https://www.ads-software.com/extend/plugins/widget-builder/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Timothy Wood

    (@codearachnid)

    Thank you for bringing this to my attention. I have a feeling it could be how the other plugins inject into the_content. I will look into a way around this.

    This is quite the hack, but I had to quickly fix this for a low traffic site. So code optimization and future theme compatibility aside, I decided to do a string replace to yank the repeated calendar entry that shows up in the widget. To do this I found the starting and ending html that was being re-injected and removed everything in between. There might be a better way but I didn’t have time.

    So in this file:

    /wp-content/plugins/widget-builder/views/widget.php

    I looked for where the widget content was rendered — which is essentially right here:

    $widget .= $content;

    just ABOVE that, I added the following code to strip the repeat from the $content variable.

    // this replacement is to remove the injection of the calendar data into the Widget Builder code at the bottom.
    $tagOne = "<a name=\"ai1ec-event\"></a>";
    $tagTwo = "</table>";
    $replacement = "<!-- CONFLICT REMOVED -->";
    
    $startTagPos = strrpos($content, $tagOne);
    $endTagPos = strrpos($content, $tagTwo);
    $tagLength = $endTagPos - $startTagPos + 8;
    
    // check to make sure it found something or else it will strip up to the tag2 if it finds it
    if($startTagPos < $endTagPos) {
       $content= substr_replace($content, $replacement, $startTagPos, $tagLength);
    }
    // end injection fix

    I should note that in my above solution, obviously there is no guarantee that the tagOne and tagTwo flags will remain consistent in the calendar code, but hopefully by then either WidgetBuilder or AllInOne will remedy the problem.

    Thread Starter RoryFoster

    (@roryfoster)

    Thank you Dannod!

    Has this been fixed yet? The issue removes the widget menu item from Appearance, even when you have deleted the plugin! It’s a shame as it was the best calendar that I found.

    I’ve spend the past two hours updating the site to fix this issue, only to have it happen again as it was the All in One Calendar that was causing the issue. (you are never sure until you try)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Widget Builder conflicts with All-in-One events calendar and Events Manager’ is closed to new replies.