Skip to content

Commit

Permalink
Revert "luci-base: force menu to regenerate after uci change"
Browse files Browse the repository at this point in the history
This reverts commit 97ebdcb.

The commit seems to cause errors already before the login screen.
Discussion in 97ebdcb#commitcomment-139871175

Errors like:

 In error(), file [C]
 called from function [anonymous function] (/usr/lib/lua/luci/ucodebridge.lua:23)
 called from function ((tail call))
 In [anonymous function](), file /usr/share/ucode/luci/runtime.uc, line 148, byte 45:
   called from function build_pagetree (/usr/share/ucode/luci/dispatcher.uc:382:73)
   called from function menu_json (/usr/share/ucode/luci/dispatcher.uc:439:26)
   called from function [anonymous function] (/usr/share/ucode/luci/dispatcher.uc:898:24)
   called from anonymous function (/www/cgi-bin/luci:39:13)

  `        return lcall.call(modname, method, ...args);`
   Near here ----------------------------------------^

Signed-off-by: Hannu Nyman <[email protected]>
  • Loading branch information
hnyman committed Mar 17, 2024
1 parent 750661d commit f2a4910
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions modules/luci-base/htdocs/luci-static/resources/uci.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,6 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
window.setTimeout(try_confirm, 250);
else
return Promise.reject(rv);
} else {
document.dispatchEvent(new CustomEvent('uci-applied'));
}

return rv;
Expand Down
4 changes: 0 additions & 4 deletions modules/luci-base/htdocs/luci-static/resources/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3478,10 +3478,6 @@ var UITable = baseclass.extend(/** @lends LuCI.ui.table.prototype */ {
}
});

// Because the menu can depend on uci values, we need to flush the cache
// after uci mutations.
document.addEventListener('uci-applied', () => UIMenu.flushCache());

/**
* @class ui
* @memberof LuCI
Expand Down
2 changes: 1 addition & 1 deletion modules/luci-base/ucode/dispatcher.uc
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function build_pagetree() {
firstchild_ineligible: 'bool'
};

let files = glob('/usr/share/luci/menu.d/*.json', '/etc/config/*', '/usr/lib/lua/luci/controller/*.lua', '/usr/lib/lua/luci/controller/*/*.lua');
let files = glob('/usr/share/luci/menu.d/*.json', '/usr/lib/lua/luci/controller/*.lua', '/usr/lib/lua/luci/controller/*/*.lua');
let cachefile;

if (indexcache) {
Expand Down

0 comments on commit f2a4910

Please sign in to comment.