working with external Database (RegisterPluginDataContext)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
hi Andrei

RegisterPluginDataContext should get a filePath to load data settings from other files part for the settings.json
6 years ago
and it should get a reloadSettings   as well
6 years ago
Hi Hezy,

Do you mean something like this?
6 years ago
yes
thank u
6 years ago
hi Andrei

the change set is working well, however:
plugins must send null and reloadSettings = true to RegisterPluginDataContext
settings must reloaded

otherwise the plugin will be installed and point the other Database and not Nop one

for example pick u in store

//data context
            this.RegisterPluginDataContext<StorePickupPointObjectContext>(builder, "nop_object_context_pickup_in_store-pickup",null, true);
6 years ago
Hi Hezy,

Do you mean if your custom plugin points to some other database, then our build-in plugins will point to that one instead of the default one?

Actually I think in this case it can cause other issues with other parts of the code where dataSettingsManager.LoadSettings() is used. For example, in \Nop.Web.Framework\Infrastructure\DependencyRegistrar.cs

So maybe, it's better to revert back these changes and leave it for plugin customization
6 years ago
a.m. wrote:
Hi Hezy,

Do you mean if your custom plugin points to some other database, then our build-in plugins will point to that one instead of the default one?


yes

please leave the changeset as is, it works with the suggestion above.  
the thing is datasettings holds the last settings which is the plugin and in order to set it back to default the reloadSettings must be true.
6 years ago
Right. We don't want to reload settings for built-in plugins (pass "reloadSettings" to "true").

I meant other point. "dataSettingsManager.LoadSettings()" can be invoked not only by plugins by other code (e.g. in \Nop.Web.Framework\Infrastructure\DependencyRegistrar.cs file). So it's better to leave for customization (at least now) so it doesn't cause issues for other developers
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.