Skip to content

Fix module priorities not to get lost#3354

Merged
vadi2 merged 2 commits intoMudlet:developmentfrom
vadi2:fix-module-prio-loading
Feb 27, 2020
Merged

Fix module priorities not to get lost#3354
vadi2 merged 2 commits intoMudlet:developmentfrom
vadi2:fix-module-prio-loading

Conversation

@vadi2
Copy link
Copy Markdown
Member

@vadi2 vadi2 commented Feb 21, 2020

Brief overview of PR changes/additions

Fix module priorities not to get lost on saving, while still keeping setModulePriority() working if called during the module installation event.

Motivation for adding to Mudlet

Bugfix.

Other info (issues closed, discussion etc)

Fixes #3345.

I took a different approach to solving it this time - since it seems a few things down the pipeline rely on the presence of a module as a flag for something. Instead of adding every module at priority 0, the setModulePriority() function will instead set the value as needed.

@vadi2 vadi2 requested a review from a team as a code owner February 21, 2020 06:03
@vadi2 vadi2 requested a review from a team February 21, 2020 06:03
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Feb 21, 2020

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@vadi2 vadi2 requested a review from a team February 21, 2020 06:10
@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Feb 21, 2020

@PhoenixCodes test this out!

}
Host& host = getHostFromLua(L);
if (host.mModulePriorities.contains(moduleName)) {
if (host.mInstalledModules.contains(moduleName)) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actually important bit of the PR.

@bduza
Copy link
Copy Markdown

bduza commented Feb 24, 2020

Tested and modules load correctly with their priorities intact.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Feb 25, 2020

Can you test setting module priorities during the module install event as well?

@vadi2 vadi2 merged commit e99c482 into Mudlet:development Feb 27, 2020
@vadi2 vadi2 deleted the fix-module-prio-loading branch February 27, 2020 04:44
vadi2 added a commit that referenced this pull request Feb 27, 2020
* Revert "setModulePriority() now when called from install event (#3327)"

This reverts commit eb6e0f6.

* Improve API error message quality

(cherry picked from commit e99c482)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module priorities are reset to 0 in 4.5.0 and 4.5.1-de

3 participants