Support » Plugin: Easy Photo Album » Uncaught ReferenceError: alternate is not defined

Viewing 10 replies - 1 through 10 (of 10 total)
  • I can confirm that upgrade to WordPress 4.5 breaks this plugin, and since it’s not being updated for 2 years now we need to search for a workaround.

    I’ve been digging a bit around the changes in WordPress 4.5 that may break the plugin.
    Basically some internals (like jQuery) are updated, so it may be related to some kind of dependency of the plugin.

    Unfortunately I don’t have much time now to dig deeper.

    The key to this JS problem is:

    “Since version 1.7.0 Underscore templates no longer accept an initial data object. _.template always returns a function now.”

    So there’s a small change needed in file easy-photo-album-page.js around line 292, something like:

    // make row from template
    var rowTemplate = _.template(EPA.rowtemplate);
    var row = rowTemplate({
        alternate : (order % 2 === 0 ? ' class="alternate"'
        ...
    });
    $('.easy-photo-album-table tr:last').after(row);

    Unfortunately, this uncovers another problem – this time in EPA_PostType.php on line 383, I’m trying to look into it now.

    Actually, the error above appears only when trying to save draft, but album can be published without errors. That’s enough for me, so I’m not planning to dig any deeper.

    Great taurit!!!

    It actually works.
    Though the .min version of the JS should be modified as well 🙂

    Thank you!

    Thanks for sharing this. I am wondering if this fixes the issue where photos can’t be added to galleries?

    Also, I’m not quite sure how to implement this change – do I need to overwrite anything in the existing js file or just add this new code in?

    Thanks again.

    Change the code inside wordpress itself should be enough.

    Thanks for your reply Agsola. Does this code replace existing code or is it to be added in without overwriting anything? I’m not savvy with js and haven’t been able to implement the code successfully yet.

    Plugin Author Aubrey Portwood

    (@aubreypwd)

    Hey I’ve forked the plugin and applied the fix’s above (and another one) and the plugin appears to be working.

    See https://wordpress.org/support/topic/photos-will-not-upload-6?replies=15#post-8436059

    Plugin Author Aubrey Portwood

    (@aubreypwd)

    This should be fixed in the next 1.3.6 release.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Uncaught ReferenceError: alternate is not defined’ is closed to new replies.