• Resolved Sagar

    (@sgtech247)


    I know alot of people are not able to get the plugin ACF Photo Gallery Field – work including me, for uploading images at the backend.

    I found a solution and its only for sometime till updates by author, simple javascript code editing – hope the author of the plugin takes this into consideration – for today and we us as community can contribute and live by it forever.

    Current live site:https://coolstufftobuyinc.com

    WordPress – WordPress Version 6.4.3

    Active plugins :-

    ACF Photo Gallery Field – Version 2.5
    Advanced Custom Fields – Version 6.2.5

    WordPress jQuery v3.7.1

    Problem :-

    /wp-content/plugins/navz-photo-gallery/assets/js/acf-photo-gallery-field.js

    Console error :-

    acf-photo-gallery-field.js?ver=2.5:104 Uncaught TypeError: Class constructor xn cannot be invoked without ‘new’
    at HTMLButtonElement. (acf-photo-gallery-field.js?ver=2.5:104:25)
    at HTMLDocument.dispatch (jquery.min.js?ver=3.7.1:2:40035)
    at v.handle (jquery.min.js?ver=3.7.1:2:38006)

    Solution:-

    EDIT the file

    /wp-content/plugins/navz-photo-gallery/assets/js/acf-photo-gallery-field.js

    Author Code – Line 103 to 141 to be changed –

                  if(typeof apgf_show_donation !== 'undefined' && apgf_show_donation){
                        swal({
                            title: 'Donation!',
                            html: 'I apologize for the inconvenience, but the ACF Photo Gallery Field plugin is requesting donations to enhance the future development of this plugin.<br/><br/>Would you like to donate?',
                            type: 'question',
                            confirmButtonText: 'Submit',
                            showCancelButton: true,
                            showCloseButton: true,
                            input: 'select',
                            inputOptions: {
                                "yes": "Yes, I want to donate",
                                "already": "I have already donated",
                                "later": "Maybe later",
                                "no": "No"
                            }
                          }).then((result) => {
                            if (result.value === 'yes') {
                                window.open("https://www.buymeacoffee.com/navzme", "_blank");
                                apgf_open_media_lib();
                            } else {
                                $.ajax({
                                    method: "GET",
                                    url: acf.get('ajaxurl'),
                                    data: {
                                        action: "apgf_update_donation",
                                        option: result.value
                                    }
                                  });
                                  apgf_open_media_lib();
                            }
                        });
                    } else {
                        apgf_open_media_lib();
                    }
                    return false;
                });
            }
        };
    }

    Code to change :-

    if(typeof apgf_show_donation !== 'undefined' && apgf_show_donation){
    Swal.fire({
    title: 'Donation!',
    html: 'I apologize for the inconvenience, but the ACF Photo Gallery Field plugin is requesting donations to enhance the future development of this plugin.

    Would you like to donate?',
    type: 'question',
    confirmButtonText: 'Submit',
    showCancelButton: true,
    showCloseButton: true,
    input: 'select',
    inputOptions: {
    "yes": "Yes, I want to donate",
    "already": "I have already donated",
    "later": "Maybe later",
    "no": "No"
    }
    }).then((result) => {
    if (result.value === 'yes') {
    window.open("https://www.buymeacoffee.com/navzme", "_blank");
    apgf_open_media_lib();
    } else {
    $.ajax({
    method: "GET",
    url: acf.get('ajaxurl'),
    data: {
    action: "apgf_update_donation",
    option: result.value
    }
    });
    apgf_open_media_lib();
    }
    });
    } else {
    apgf_open_media_lib();
    }
    return false;
    });
    }
    };
    }

    The only change as off now is to edit :-

     swal({
                            title: 'Donation!',
                            html: 'I apologize for the inconvenience, but the ACF Photo Gallery Field plugin is requesting donations to enhance the future development of this plugin.<br/><br/>Would you like to donate?',
                            type: 'question',
                            confirmButtonText: 'Submit',
                            showCancelButton: true,
                            showCloseButton: true,
                            input: 'select',
                            inputOptions: {
                                "yes": "Yes, I want to donate",
                                "already": "I have already donated",
                                "later": "Maybe later",
                                "no": "No"
                            }

    To the following: –

     Swal.fire({
                                title: 'Donation!',
                                html: 'I apologize for the inconvenience, but the ACF Photo Gallery Field plugin is requesting donations to enhance the future development of this plugin.<br/><br/>Would you like to donate?',
                                type: 'question',
                                confirmButtonText: 'Submit',
                                showCancelButton: true,
                                showCloseButton: true,
                                input: 'select',
                                inputOptions: {
                                    "yes": "Yes, I want to donate",
                                    "already": "I have already donated",
                                    "later": "Maybe later",
                                    "no": "No"
                                }

    Line 104 to 117.

    swal({

    to

    Swal.fire({

    It will work.

    Live website post :- https://coolstufftobuyinc.com/est-18-in-1-ultimate-multi-tool-shovel/

    Cheers.

    Sg

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.