View Issue Details

IDProjectCategoryView StatusLast Update
0005743OXID eShop (all versions)2.3. Extensions (modules, themes)public2023-11-27 15:23
Reporterrevoltek Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0005743: Module is activ even if onActivate Event failed
DescriptionHello,

if an Module uses the onActivate Event it should only be active if this method runs without an error.

In my case i check for file perms in the onActivate method so when this failed an exception is thrown. The exception is displayed but the module is also activated.
TagsNo tags attached.
ThemeAzure
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Activities

FibreFoX

2014-04-24 15:26

reporter   ~0009859

a nicer module-handling would really be appreciated, for me i would prefer an exception instead of having to return false/true (gives more power to specify more-detailed information instead of just having a nothing-telling "no, cant activate" as choice)

quick workaround could be to deactivate that module programmatically within your onActivate-event (loading modules and disable it).

SvenBrunk

2023-11-27 15:23

administrator   ~0015972

There might be a misunderstanding about what the onActivate event is:
It only tells about an activation happened and gives you an opportunity to do additional things based on this information.

In case you want the module to be inactive if something happens in your activation code, you can add a try / catch block yourself and call the ModuleActivationService to deactivate the module again.