Forum Replies Created

Viewing 15 replies - 1 through 15 (of 27 total)
  • Thread Starter AdrianFx

    (@adrianfx)

    Here is my current permanent fix for version 1.12.6 and maybe above. Error or fix is marked in bold on cluevo-mod.js file. You might need to review the code there, see conclusions at the bottom.

    1. First I’ve added In theme functions.php this code:
    // Conditional enqueueing of modified script and its dependencies
    function enqueue_mod_script_conditionally() {
        // Check if either 'cluevo-scorm' or 'cluevo' plugin script is enqueued
        if ( wp_script_is( 'cluevo-scorm', 'enqueued' ) || is_plugin_active( 'cluevo-lms/cluevo-lms.php' ) ) {
            // Enqueue cluevo-scorm-wrapper if it's not already enqueued
            if ( ! wp_script_is( 'cluevo-scorm-wrapper', 'enqueued' ) ) {
                wp_enqueue_script( 'cluevo-scorm-wrapper' );
            }
            
            // Enqueue cluevo-scorm if it's not already enqueued
            if ( ! wp_script_is( 'cluevo-scorm', 'enqueued' ) ) {
                wp_enqueue_script( 'cluevo-scorm' );
            }
            
            // Enqueue your modified script
            wp_enqueue_script( 'cluevo-mod-script', get_stylesheet_directory_uri() . '/assets/javascript/cluevo-mod.js' , array( 'cluevo-scorm' ), '1.0.0', true);
        }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_mod_script_conditionally', 999 ); // Use a high priority to ensure it runs late
    

    2. Made file in theme /assets/javascript/cluevo-mod.js below:

    // Wrap the original function
    (function() {
        var originalShowResumePrompt = showResumePrompt;
    
        // Redefine the showResumePrompt function with your fix
        showResumePrompt = async function(itemId, data, callback) {
            // Your fixed implementation here
    
            cluevoRemoveTileOverlays();
            var el =
            '<div class="cluevo-module-tile-overlay"><h2>' +
            cluevoStrings.start_over_dialog_header +
            '</h2><div class="cluevo-prompt-btns-container"><div class="cluevo-btn yes">' +
            cluevoStrings.start_over_opt_reset +
            '</div><div class="cluevo-btn no">' +
            cluevoStrings.start_over_opt_resume +
            "</div></div></div>";
            var dialog = jQuery(el);
            var needLightbox =
            jQuery(
                '.cluevo-content-item-link[data-item-id="' +
                itemId +
                '"] .cluevo-post-thumb:first'
                ).length === 0;
            dialog.on("click", ".cluevo-btn.yes", async function() {
                cluevoShowLightboxSpinner();
                var url =
                cluevoWpApiSettings.root + "cluevo/v1/modules/" + itemId + "/new-attempt";
                await jQuery.ajax({
                    url: url,
                    method: "GET",
                    contentType: "application/json",
                    dataType: "json",
                    beforeSend: function(xhr) {
                        xhr.setRequestHeader("X-WP-Nonce", cluevoWpApiSettings.nonce);
                    },
                    success: function(response) {
                        jQuery(dialog).remove();
                        if (needLightbox) {
                            cluevoCloseLightbox();
                        }
                        callback(true, response);
                    },
                });
            });
            dialog.on("click", ".cluevo-btn.no", function(e) {
                e.stopPropagation();
                e.preventDefault();
                jQuery(dialog).remove();
    /******** the actual fix - next 3 lines *******/
                if (needLightbox) {
                    cluevoCloseLightbox();
                }
                callback(false);
            });
            dialog.on("click", ".cluevo-btn:not(.no)", function(e) {
                e.stopPropagation();
                e.preventDefault();
                jQuery(dialog).remove();
    /******** nonsense maybe *******/
                if (!needLightbox) {
                    cluevoCloseLightbox();
                }
            });
            if (!needLightbox) {
                jQuery(
                    '.cluevo-content-item-link[data-item-id="' +
                    itemId +
                    '"] .cluevo-post-thumb:first'
                    ).append(dialog);
            } else {
                cluevoOpenLightbox(null, "", dialog);
                cluevoShowLightbox();
            }
            jQuery(dialog).fadeIn();
        }
    })();

    Conclusion:
    1. “.cluevo-btn.no” does not have a lightbox close logic similar to “.cluevo-btn.yes”
    2. “.cluevo-btn:not(.no)” => “.cluevo-btn.yes” OR “.cluevo-btn.cluevo-close-button” – you have specific logic for “.yes”, and no logic or function for close button, but if lighbox was not needed you close it anyway.
    3. script “cluevo-scorm” requires “cluevo-scorm-wrapper” – it’s a small thing but I couldn’t add my mod without fixing the enqueue order. ChatGPT helped to write the code and enqueue my mod.

    You may close the issue after reading it. But I hope you will fix it, if not it may serve the next person with this issue.

    Thread Starter AdrianFx

    (@adrianfx)

    One more thing I found out. Settings -> Module Settings -> Module attempts -> [Selected] Always start new attempts

    I still got asked if I want to resume.

    Thread Starter AdrianFx

    (@adrianfx)

    I’ve just install this on a new site. I made my own “blank” template with the help on 2024 theme and the page contains only the shortcode with id. I’ve added JS to open the page in a custom size popup. And all works except this annoyance that was not resolved.

    When I open the course I get this page, that is normal:

    I click on “Resume” and the buttons go away. I am now left with this blank overlay:

    You can see the course trough the overlay. That is the default Adobe Captivate “play” / start button.

    User has to manually close the blank overlay first in order to continue.

    “New attempt” button works fine.

    • This reply was modified 9 months ago by AdrianFx.
    Thread Starter AdrianFx

    (@adrianfx)

    In my haste, I didn’t realize that overlay also holds the resume buttons, and now the page goes black and user is stuck. My fix makes it worse.

    So there are two scenarios:
    1. User click “Resume” than overlay remains and user needs to press the X button on overlay… and everything works ok.
    2. User clicks X button on overlay first page goes black and user is stuck without the course visible.

    Last one is impairing the user of using the site.

    Update:
    I’ve compared to older versions and found that cluevo.js line 1208 dialog.on("click", ".cluevo-btn.no" doesn’t call cluevoCloseLightbox(); anymore. I’ve put it back and hid the close button with CSS and seams to be working fine for me. But some logic around that section has changed and might need to be adjusted.

    • This reply was modified 11 months, 2 weeks ago by AdrianFx.

    Same same, with wordpress 5.9.3 and 6.0, but works with wordpress 5.8.2. I think they updated things in jQueryUI.

    AdrianFx

    (@adrianfx)

    I’ve notice a JavaScript error that blocks execution. This happens on click on resume button when inside an iFrame. I don’t know if it’s limited to this scenario only.

    It starts from here: cluevo.js:901 – initIframe(itemId, response.iframe_index);
    Crashes here: cluevo.js:433 – next(false);

    The third parameter is not passed and therefore next is undefined.

    Suggested edit:

    
    function (success, module) {
      <strong>if (typeof next !== 'function') {</strong>
        if (success) {
          next(true, module);
        } else {
          next(false);
        }
      <strong>}</strong>
    }
    

    Bold indicates addition to existing code.

    This worked form me, by skipping the problem, but I have no idea what it should be doing or if it’s a correct approach.

    Me too after update to v2.0.1:

    [19-Oct-2021 14:42:58 UTC] PHP Warning:  require(WPGDPRC.php): failed to open stream: No such file or directory in www/wp-content/plugins/wp-gdpr-compliance/wp-gdpr-compliance.php on line 55
    [19-Oct-2021 14:42:58 UTC] PHP Warning:  require(WPGDPRC.php): failed to open stream: No such file or directory in www/wp-content/plugins/wp-gdpr-compliance/wp-gdpr-compliance.php on line 55
    [19-Oct-2021 14:42:58 UTC] PHP Fatal error:  require(): Failed opening required 'WPGDPRC.php' (include_path='www/wp-content/plugins/backwpup/vendor/pear/archive_tar:www/wp-content/plugins/backwpup/vendor/pear/console_getopt:www/wp-content/plugins/backwpup/vendor/pear/pear-core-minimal/src:www/wp-content/plugins/backwpup/vendor/pear/pear_exception:.:/opt/alt/php72/usr/share/pear') in www/wp-content/plugins/wp-gdpr-compliance/wp-gdpr-compliance.php on line 55 

    WP Version: 5.8.1
    PHP Version: 7.2
    Installed plugins:

    advanced-custom-fields-pro/
    backwpup/
    classic-editor/
    contact-form-7/
    elementor/
    essential-grid/
    mailchimp-for-wp/
    mp-timetable/
    old-style-admin-ui/
    revslider/
    search-filter/
    trx_addons/
    wordfence/
    Thread Starter AdrianFx

    (@adrianfx)

    /woo-stripe-payment/includes/admin/class-wc-stripe-admin-notices.php

    Lines 58 to 59
    … < span > ‘,
    ‘ < / span > < / a > ‘

    Remove extra spaces from tags.

    Same issue.

    But you can use ‘languages/plugins/’ folder when you create a language. Also don’t forget to increase Polylang file size when you create the template. I got a warning that I ignored a few times.

    Thread Starter AdrianFx

    (@adrianfx)

    There is no summary page if there is no quiz. ??

    Will make an issue, thanks.

    How was this resolved?

    Same error, but upgrading to WordPress 4.9.6 seams to fix it.

    Thread Starter AdrianFx

    (@adrianfx)

    That save button from the bottom, add one more on the top.

    This now works fine, but I would love to have the original version work as well. You just need to add a checkbox in options to process or not short-codes when uploading data.

    Thread Starter AdrianFx

    (@adrianfx)

    Hello,

    I’ve tried it your way, I can see the results in account, but integration failed. I get the autocomplete, but the results page seams to fail to load anything. https://dev.thedude.no/stand/find/?q=pall

    Also I need a way to hook in your JS to catch when the mobile form, transforms in full page search. Right now I have a hamburger style menu from the side, and that moves the body, but I need to know when your search has shown up so I can close the menu.

    Thread Starter AdrianFx

    (@adrianfx)

    I’ve added “Google XML Sitemaps” plugin and created a sitemap. Next I did a “Full Resynchronize Posts” from your plugin. Staging site is available to public view.

    Not exactly sure where you JS solution is, or how sitemap plays in all this, but my problem remains the same.

    https://dev.thedude.no/siq/Screenshot3.png – search result to a page with lots of text, has empty text in it’s preview.

    As I’ve hinted in one of my comments above, you have a function strip_shortcodes_from_content in your plugin. As my content is created exclusive on shortcodes, and this basicaly deletes all my content. I could just hack my way in your extension, but I don’t want to create any issues. Maybe add an option to process shortcodes or not. This would solve my issue, and potentially any future clients.

    PS: You should be able to resolve this issue quite fast since I’ve already told you where the problem is.

Viewing 15 replies - 1 through 15 (of 27 total)