parser BUGFIX if a parsed module is already in the context, make sure it is enabled
diff --git a/src/parser.c b/src/parser.c
index fbb1348..e5f5d7a 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -3445,6 +3445,12 @@
                     || !strcmp(ctx->models.list[i]->rev[0].date, last_rev)) {
 
                 LOGVRB("Module \"%s\" already in context.", ctx->models.list[i]->name);
+
+                /* if disabled, enable first */
+                if (ctx->models.list[i]->disabled) {
+                    lys_set_enabled(ctx->models.list[i]);
+                }
+
                 to_implement = module->implemented;
                 match_i = i;
                 if (to_implement && !ctx->models.list[i]->implemented) {
diff --git a/src/parser.h b/src/parser.h
index 805a602..bc4c42e 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -153,7 +153,7 @@
  */
 int lyp_propagate_submodule(struct lys_module *module, struct lys_include *inc);
 
-/* return: -1 = error, 0 = succes, 1 = already there */
+/* return: -1 = error, 0 = succes, 1 = already there (if it was disabled, it is enabled first) */
 int lyp_ctx_check_module(struct lys_module *module);
 
 int lyp_ctx_add_module(struct lys_module *module);