• Resolved greencode

    (@greencode)


    Click Update and nothing happens. If I turn off this plugin then it Updating products works. Looking at the page errors and I’m getting this:

    Uncaught Error: Template not found: #tmpl-facebook-for-woocommerce-modal
        at wp-util.min.js?ver=9ae1c6c3027916513f1e30d179c0c6bd:2:371
        at n.render (backbone-modal.min.js?ver=7.1.0:1:968)
        at Jn (underscore.min.js?ver=1.13.4:2:7441)
        at n.<anonymous> (underscore.min.js?ver=1.13.4:2:7755)
        at n.render (underscore.min.js?ver=1.13.4:2:1065)
        at n.initialize (backbone-modal.min.js?ver=7.1.0:1:839)
        at h.View (backbone.min.js?ver=1.4.1:2:14648)
        at new n (backbone.min.js?ver=1.4.1:2:23485)
        at Object.success (products-admin.js?ver=3.0.3:1:7967)
        at c (jquery.min.js?ver=3.6.1:2:28327)
Viewing 15 replies - 16 through 30 (of 34 total)
  • Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    Thank you @greencode for your clarification. We’ve been trying to reproduce this issue based on your SSR. However, we are unable to reproduce this issue.

    Technically, the product-admin.js file and the tmpl-facebook-for-woocommerce-modal is generated on the same condition. The only difference is, product-admin.js is fired earlier and tmpl-facebook-for-woocommerce-modal is fired later (specifically at the admin_footer hook).

    We noticed that you are using some plugins that might conflict with our plugin. At this stage, I’d recommend that you do 2 things:

    Check for errors in logs.

    1. Go to WooCommerce > Status > Logs
    2. In the top right corner, open the drop-down and select the plugin log that you need, then click view to load it. Here’s what that looks like: https://d.pr/i/tCljQd
    3. Copy/paste the relevant part of the log into your response so we can take a look.

    Do a conflict test.

    1. Temporarily deactivate all plugins except WooCommerce and Facebook for WooCommerce. You can do this manually or use a plugin to help (see below for tools).
    2. Try to reproduce the problem again. If the problem is resolved, it’s a plugin conflict. To figure out which plugin is causing the problem, continue to the next step.
    3. Reactivate your other plugins one by one, testing after each, until you find the one causing conflict.

    For more detailed instructions, check out: How to test for plugin and theme conflicts.

    Please let us know how that goes.

    Tools to help with troubleshooting

    Meks Quick Plugin Disabler will remember what plugins you had active when you switch it back on.

    You can clone your site to a staging environment and perform tests without modifying your live site or impacting customers. Many hosts provide staging facilities, so it’s worth checking in with them. It’s also possible to do it using the free WP Staging plugin.

    Thread Starter greencode

    (@greencode)

    @kaderibrahim I’ve just deactivated all plugins except Facebook and WooCommerce and reverted to a standard WordPress theme. Still the issue exists

    load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:148 Uncaught Error: Template not found: #tmpl-facebook-for-woocommerce-modal
        at load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:148:371
        at n.render (backbone-modal.min.js?ver=7.1.0:1:968)
        at Jn (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:144:7441)
        at n.<anonymous> (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:144:7755)
        at n.render (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:144:1065)
        at n.initialize (backbone-modal.min.js?ver=7.1.0:1:839)
        at h.View (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:146:14648)
        at new n (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:146:23485)
        at Object.success (products-admin.js?ver=3.0.5:1:7965)
        at c (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,wp-backbone,media&load%5Bchunk_1%5D=-models,moxiejs,plupload&ver=6.1.1:2:28327)
    Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    Thank you @greencode for the additional information. We’d need to un-concatenate the scripts to understand the issue clearly. Please add this line of code temporarily to your wp-config.php file and let us know what the error is:

    
    define( 'CONCATENATE_SCRIPTS', false );
    

    The above code needs to be added in the wp-config.php above the line that says /* That's all, stop editing! Happy publishing. */.

    Additionally, can you please check the error logs and provide us with the details?

    You can find the error logs in: WP Admin → WooCommerce → Status → Logs

    Thread Starter greencode

    (@greencode)

    @kaderibrahim I’ve added that to wp-config. Where do I see what the error is?! There’s nothing in the error logs for this specific time.

    Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    @greencode, Thank you for getting back. If there is nothing in the logs then it means that the server did not generate any errors.

    With the above code added to the wp-config.php, were you able to reproduce the issue that you stated originally?

    Thread Starter greencode

    (@greencode)

    @kaderibrahim Still the same issue and no errors are getting generated other than this when I click the Update button

    wp-util.min.js?ver=9ae1c6c3027916513f1e30d179c0c6bd:2 Uncaught Error: Template not found: #tmpl-facebook-for-woocommerce-modal
        at wp-util.min.js?ver=9ae1c6c3027916513f1e30d179c0c6bd:2:371
        at n.render (backbone-modal.min.js?ver=7.1.0:1:968)
        at Jn (underscore.min.js?ver=1.13.4:2:7441)
        at n.<anonymous> (underscore.min.js?ver=1.13.4:2:7755)
        at n.render (underscore.min.js?ver=1.13.4:2:1065)
        at n.initialize (backbone-modal.min.js?ver=7.1.0:1:839)
        at h.View (backbone.min.js?ver=1.4.1:2:14648)
        at new n (backbone.min.js?ver=1.4.1:2:23485)
        at Object.success (products-admin.js?ver=3.0.5:1:7965)
        at c (jquery.min.js?ver=3.6.1:2:28327)
    Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    Thank you for checking this for us. With the information provided so far, we are unable to determine the real cause of the issue and provide a fix.

    I’d like to debug this further with the help of some custom code. Here is the custom code:

    
    add_action( 'admin_footer', 'fbwc_debug' );
    function fbwc_debug() {
    	global $current_screen;
    	echo '<script>console.log(' . json_encode( $current_screen ) . ')</script>';
    }
    

    The above code will verify that admin_footer action is triggered correctly and the $current_screen global variable has the value that is required to load the template.

    Please follow the instructions below to help us debug:

    1. You need to add the above custom code to your theme’s functions.php
    2. Please go to the admin screen that throws the error and capture the browser console. You’d need to right-click on the browser and select Inspect Element
    3. Take a screenshot and share it with us.

    I’ve captured how it is done in this screenshot: https://tinyurl.com/2nmsdrc9

    The screenshot is from the theme editor screen, you’ll have to capture it in the screen where the error occurs.

    Please remove the added debug code after capturing the screenshot.

    Thread Starter greencode

    (@greencode)

    @kaderibrahim Appreciate your help with this. Here’s the screenshot – hoping that’s what you require https://ibb.co/nwxzgyZ

    Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    Thank you very much. Can you please confirm that you’ve added the debug code to your theme’s functions.php before capturing it? Can you please post the same screenshot from the theme editor screen and the test product screen after deactivating all the plugins except WooCommerce and Facebook for WooCommerce? ( I recommend doing this on a staging site instead of a live site )

    From this screenshot, I can see the Object. Can you please click on it to expand it? and post the result here.

    Thread Starter greencode

    (@greencode)

    Yes, I’ve added the debug code.

    I’ve reverted to a standard WordPress theme and only WooCommerce and Facebook plugins are active.

    https://ibb.co/rHqrMsb

    Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    I’ve added the debug code.

    I’ve reverted to a standard WordPress theme

    Thank you. The debug code should be in the active theme. So after switching to a WordPress standard theme, please make sure to add it to the active theme’s functions.php

    Thread Starter greencode

    (@greencode)

    AH, sorry. Here you go, actually with the correct site theme as I’ve no idea where the funcions file is in the latest TwentyTwenty theme!

    https://ibb.co/YZMg3FP
    https://ibb.co/m4ZTpPK

    Plugin Author Kader Ibrahim S. a11n

    (@kaderibrahim)

    Thank you. The screenshot is helpful in ruling out some assumptions that I made about the cause of the issue. At this point, I am not sure what is causing the issue. I’d need more time to investigate this issue.

    Alternatively, you can add this temporary fix to your theme’s functions.php:

    https://gist.github.com/ibndawood/d418d4acfed07f28557ab22df9e9f6cd

    Let me know if the above temporary fix did not resolve your issue.

    Plugin Support Sean O))) a11n

    (@seanomattic)

    Hi @greencode,

    If Kader’s latest suggestion does not help resolve this error, please open a support ticket and be sure to reference this forum post.

    Thanks!

    Thread Starter greencode

    (@greencode)

    @seanomattic @kaderibrahim Just so you know, the code fix did not work as that did not allow any product to be updated! However, I’ve figured out what the issue was. Basically, it wasn’t connected to Facebook. Once connected everything works okay.

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘Unable to update products when this plugin is active’ is closed to new replies.