Add-on Update File - return values from parent installer class #715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
In previous versions of the documentation, the value returned from
install()/uninstall()
is determined by the invocation of the parent class methods. See here.Supporting Argument
Lets examine the routine which a add-on may encounter during installation (
install()
). All add-ons (which poses modules) must update theexp_modules
database table. This process is taken care of by callingparent::install()
. Then lets suppose that the add on needs to create a database table.Steps
exp_modules
tableIf the order of these operation takes place such that the module is added and then the database tables are created, an error may occur in which the add-on is not successfully installed.
Current order of operations (see Sample Code below)
exp_modules
tableLets say for example that there is an issue when creating the database tables. The problem here is that the modules database table (
exp_modules
) has been updated to suggest that the add-on is in fact installed correctly. But during installation, the error occurred in which necessary database forge operations did not successfully complete.Suggested order of operations
exp_modules
tableThis would allow the add-on to independently validate whether or not the installation process completed successfully before the parent operations took place.
Code Samples
Current Documentation
Old Documentaion
Resolves #NN.
Nature of This Change