WordPress.org

Support

Support » Plugins and Hacks » File Gallery & WPML Javascript Issue

File Gallery & WPML Javascript Issue

  • Hello,

    Thank you for creating such a great plugin!

    I’m currently having an issue with File Gallery with the WPML plugin installed. Issue is occurring when File Gallery is attempting to insert the “Copy all attachments from this translation ” buttons on the edit post page. If WPML is set to use the translation editor, the error below occurs.

    Error: Uncaught TypeError: Cannot call method ‘pop’ of null
    Source: file-gallery.js:1653

    var fg_icl_trans_id = Number($(this).attr('href').match(/post=([\d]+)&/).pop());

    I placed a breakpoint on this line and the current value of $(this).attr(‘href’) is: /admin.php?page=wpml-translation-management/menu/translations-queue.php&job_id=49

    Obviously the URL is different if ‘Use Translation Editor’ is selected in WPML. Because of the error a number of interface related issues appear.

    Personally, I’d be happy for the button not to be there at all if using the translation editor.

    WordPress: 3.5
    WPML: 2.6.1
    File Gallery: 1.7.7

    Your support is much appreciated.

    Thank you and kind regards,
    Paul

    http://wordpress.org/extend/plugins/file-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • My temporary fix:

    Replaced file-gallery.js:1653 with:

    // FIXED: issue where WPML editor is set to translation editor
    var fg_icl_trans_id = '';
    var fg_icl_trans_match = $(this).attr('href').match(/post=([\d]+)&/);
    
    if (fg_icl_trans_match)
    	fg_icl_trans_id = Number(fg_icl_trans_match.pop());
    Plugin Author Aesqe
    Member

    @aesqe

    thanks for reporting and supplying a fix! 🙂

    included in v1.7.8, out soon.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘File Gallery & WPML Javascript Issue’ is closed to new replies.