• Resolved Tomas Novotny

    (@stoupa)


    Hi,

    I hit a problem with this plugin, but as it looks so nice, I dig into it and I have some kind of workaround. I would like to discuss a proper fix, so here are the information:

    I’ve been trying the plugin on our site (13 years (!) old installation with several major upgrades, 500+ posts, 100+ users, 40 plugins) and it caused a server segfault when a page or post with a map was opened. It turned out that the problem is caused by get_the_excerpt(...) call on that line: https://plugins.trac.www.ads-software.com/browser/travelers-map/trunk/includes/public/cttm-shortcode.php#L254

    I quite blindly changed it to this line:
    $cttm_postdatas['excerpt'] = has_excerpt($cttm_post->ID) ? get_the_excerpt($cttm_post->ID) : '';
    and it started to work like a charm.

    I checked the geolocated posts and there was no excerpt entered. I entered excerpts, reverted my workaround and the map started to work.

    Do you think that configuration or data on our site are somehow buggy? Or is the call to get_the_excerpt() somehow wrong (there are some caveats mentioned in the discussion in manual)? I’d be happy to test more things if you have some idea.

    Thanks,

    Tomas

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Camille V

    (@socrapop)

    Dear Tomas, thank you for all the debugging ??

    If your workaround was working, I can simply add it to the plugin’s code!
    I don’t know why your site crashes when every other install don’t, what WP version are you on? 13 year old is impressive!

    I though get_the_except was already checking if an excerpt exist or not, but maybe I was wrong!
    Maybe you have a function of plugin that is altering with the excerpts?

    Anyway I can add your workaround if you confirm it was working with it ??

    Have a nice day !
    And sorry for the mess in the code, I’m currently refactoring, it will be a lot cleaner in V2 ?? (the plugin was originally not meant to be this big and shared to the community ??)

    Thread Starter Tomas Novotny

    (@stoupa)

    Dear Camille,

    thanks a lot for the prompt reply!

    We are at WP 5.5.3 localized to Czech. All plugins are usually also on the latest version, so this shouldn’t be an issue. A was rather thinking about some corner case configuration carried through decade.

    I was also suspecting plugin ‘Event Calendar 3 for PHP 5.3’, as this is a quite old and unsupported plugin. But I cannot easily disable it. My friend is currently fixing it.

    Anyway, I don’t know the root cause of our crash, although the workaround is fixing the segfaults. I’m not a big fan of adding some check which may hide a bug which will arise later. So I will dig deeper and let you know.

    Thanks again,

    Tomas

    Thread Starter Tomas Novotny

    (@stoupa)

    So the problem is really “Event Calendar 3 for PHP 5.3”. I’ve disabled the filter ec3_get_the_excerpt and the Travelers’ Map started to work even without my workaround.

    Sorry to bother you and thanks a lot for the plugin.

    Tomas

    Plugin Author Camille V

    (@socrapop)

    Dear Tomas,

    I’m glad you found the source of the problem ??

    Have a nice day,
    Camille

    Hi Camille,

    I just came across this post and wanted to mention that it looks like I have a similar problem with Falang for the excerpts (don’t know if you remember).

    Everything works fine in Travelers’ Map with Falang, but I need to comment line 254 in /plugins/travelers-map/includes/public/cttm-shortcode.php, otherwise the translated posts show a blank page when there is a map present. With that line commented everything is hunky dory.

    Just to see what happens, I entered Tomas’ adaptation instead of just commenting the whole line. Now everything works fine also in translated posts with a map.

    In my case there do not seem to be conflicting plugins which can be the culprit, only thing I have different is the automatic excerpt length set in functions.php of my (Enfold) child theme:

    add_filter(‘avf_postgrid_excerpt_length’,’avia_change_postgrid_excerpt_length’, 10, 1);
    function avia_change_postgrid_excerpt_length($length)
    {
    $length = 150;
    return $length;
    }

    Do you have any idea why this could be happening? Thanks for your support and this great plugin! I can give you access to a development server if you want to investigate, just let me know and I will send you the details in private.

    Have a good day,
    Rob

    Plugin Author Camille V

    (@socrapop)

    Dear Rob,

    The problem seems to lie in get_the_excerpt used outside of the loop as mentionned in the documentation comments section:
    https://developer.www.ads-software.com/reference/functions/get_the_excerpt/#comment-2457

    Tomas’ fix is disabling all automatic generated excerpts, replacing them with an empty string. It’s good if you don’t use excerpts in popovers, but annoying if you do, because you will have to write custom excerpt for all your posts.
    So that can’t be implemented in the plugin.

    But I will try to find a way to fix it the way they describe it in the link above. (after my holidays ;))

    Hi Camille,

    Thank you for looking into this and the explanation link, I didn’t know about that issue outside of the loop.

    Wish you happy holidays!

    Rob

    Hi Camille,

    I was working on this yesterday and the problem is in Falang component due to the get_the_exerpt.
    because when no exerpt is write the exerpt is make with the content and it’s make a loop in falang.
    The translation of content the_content don’t have the global post set to post but to the page.
    I was looking for a solution and it’s probably in the link you post

    Thanks a lot.
    Stéphane

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Crashes when no excerpt is entered’ is closed to new replies.