0

I have a problem with saving the T3 Framework megamenu

In practice, after setting the megamenu and clicking on save, it does not save.

Inspecting I found some JS errors that I can't solve, the errors are:

megamenu.js: 463 Uncaught TypeError: Cannot set property 'undefined' of undefined
     at Object.actions.saveConfig (megamenu.js: 463)
     at HTMLButtonElement. <anonymous> (megamenu.js: 71)
     at HTMLButtonElement.dispatch (jquery-1.8.3.min.js: 2)
     at HTMLButtonElement.u (jquery-1.8.3.min.js: 2)
     at Object.trigger (jquery-1.8.3.min.js: 2)
     at HTMLButtonElement. <anonymous> (jquery-1.8.3.min.js: 2)
     at Function.each (jquery-1.8.3.min.js: 2)
     at init.each (jquery-1.8.3.min.js: 2)
     at init.trigger (jquery-1.8.3.min.js: 2)
     at HTMLButtonElement. <anonymous> (megamenu.js: 983)

I need help to solve it.

Update: the two line js of megamenu

Line 463 (from 456 to 477)

var menutype = $('#jform_params_mm_type').val(),
    curconfig = T3AdminMegamenu.config;

if($.isArray(curconfig) && curconfig.length == 0){
    curconfig = {};
}

**curconfig[menutype] = config;**

$.ajax({
    url: T3AdminMegamenu.referer,
    type: 'post',
    data: {
        t3action: 'megamenu',
        t3task: 'save',
        styleid: T3AdminMegamenu.styleid,
        template: T3AdminMegamenu.template,

        mmkey: $('#megamenu-key').val(),
        config: JSON.stringify(config),
        rand: Math.random()
    }

Line 71 (from 65 to 75)

// bind event for action
        $('.toolbox-action').click (function(event) {
            var action = $(this).data ('action');

            if (action) {
                actions.datas = $(this).data();
                **actions[action] ();**
            }
            event.stopPropagation();
            return false;
        });
4
  • For volunteers who do not have megamenu in their own project to reference, are you able to show the relevant lines of code associated with this error? – mickmackusa Mar 27 at 21:43
  • @mickmackusa hi, I update the post with the two relevant lines between ** ** in code. Thanks – Joso Mar 27 at 22:00
  • I use T3 rather extensively and haven't come across this in any Joomla 3.x version. What version of Joomla are you using? Have you overridden any of the t3 core? – Grant G Mar 29 at 10:28
  • Hi Grant, I contacted a freelance to solve the issue, and now it works... He changed something in megamenu.tlp.php file. – Joso Mar 29 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.