Comments (10)
After reading topic about 'exporting contents of custom modules' for time of update i got some idea.
It can be done the way wolf want, and it can be transparent and easy as just clicking uninstall and install.
When user click uninstall - plugin will delete its templates ect as usual, but instead of deleting #_sideboxes table
it can be renamed to #_sideboxes_bak and just leave there.
If user install new version or even simply click 'install' on the same version,
Installation routine will look for #_sideboxes_bak and copy valid columns to new #_sideboxes table
(some columns may not exsist in next version or there may be new columns which not exsisted in old one,
in this case, not exsisting columns will be simply skiped or default value will be inserted.
This way no copy paste, no save xml's or whatever is required.
Just simple as they want - click uninstall - click install and it magically preserve old settings.
Thats about preserving settings along with custom modules content,
About templates - because some users like to customise his templates sometime aswell,
they may ofcourse see it as 'hard work of customising template is lost' ... (but does not MyBB do it all the time?)
Most easy would be simply not delete adv_sidebox_* templates on uninstall, so they not lose it.
When plugin install it would look if adv_sidebox_* template exsist,
if not then insert it,
if yes then compare it with new version which should be inserted, and if its same then do nothing
(its allready there after all)
if old template exsist but its different than new template which should be inserted
then rename exsisting template to adv_sidebox_*_bak, insert new template and show warning to user
that 'old template was incompatible with new format and he should perform changes manualy'
(he will have new template updated and still have old renamed template so not lose his customising work)
They shouldnt complain about this - MyBB do this by itself when there is update to templates
and it not even make any bak - it simply replace template and its poof, customisation gone.
from advanced-sidebox.
This feature is not a method of circumventing the need for full uninstall/reinstall upgrades. I feel that it has merit in the over-all scheme of sharing and making things easier.
I would like to incorporate an automated upgrade method that would have much the same effect that you are suggesting, but without all the backing up. From what I am researching now (by checking out other plugins that have upgrade routines built into the _activation routine (so you can just copy files and deactivate/reactivate and upgrade is complete.)
This is done by saving the version number in the cache and then creating an upgrade script that gets called in the _activation function. It then checks the old version against the current version and makes appropriate changes to the database/settings/templates and doesn't erase any custom boxes, lose any settings or any other inconvenience.
The problem with that one is time . . . I honestly can't even commit to a time frame on that feature.
Cheers
from advanced-sidebox.
'sharing setup' sounds interesting.
Its not like i expected 'preserving settings betwin installations'. I was even surprised by this idea
because im used that 'uninstall something meant - lose settings',
but it looks like they insist and refuse to upgrade if settings have to be lost.
oh well, even MyBB itself overwrite its templates on update.
from advanced-sidebox.
Well Wolfseye is right about one thing: It is possible to make big changes in the plugin and not make users have to do a full reinstall. I just don't think he realizes that I have to learn how to do that before I can safely release that code to people :D
from advanced-sidebox.
Oh, even if you would implement this and i believe it would be brilliant,
dont you think people have many plugins which not support such feature,
and at the end they will always fear to touch anything to not lose customisation.
They have to follow rules - do not mod core files, conserve precious data, make backups before major upgrades.
If they not do this, meant they still not care that much as they claim they do.
If youre curious about my opinion, personaly i think 'uninstall' meant exacly this - erase all
for sake of clean installation of new version. Free from old bugs and possible invalid user data.
Preserving data and perchance adapting it to new version is responsibility of user.
If not - we would stuck in windows 95 era maintaining compatibility and preserving 8 bit dos applications.
If you would do a poll about it, you allready had a sample in mybb forum that most of people agreed
to fact that its natural to expect that data can be erased on uninstall and one should preserve it by himself,
and that this data may no more become fully compatible with new version if there was major changes.
from advanced-sidebox.
Yes I agree and am not proposing to change the way Install/Uninstall works at all. If you uninstall the plugin it will do the same thing it does now: deactivate and uninstall fully removing all changes.
What I am considering is a small conditional in acp_functions.php -> adv_sidebox_activate that gets the version of ASB that is installing before upgrade, checks to see if any changes are needed and if so calls the upgrade script that will check/replace/insert each element that is missing in the old version.
So to upgrade the admin would simply deactivate the plugin, overwrite the existing files and then reactivate the plugin and that is all. No settings would be lost, all custom boxes and sideboxes would remain intact.
from advanced-sidebox.
ok 👍
from advanced-sidebox.
Added import/export features for user-defined box types.
from advanced-sidebox.
Hey Wildcard, please dont take my comments on MyBB offensive, they were not ment to be. And compared to what I know about all these things, even as your plugin is now, you're WAY ahead of me in any direction there. I know things dont work out always like one wishes. But asking doesnt cost anything. :)
from advanced-sidebox.
I was never offended- only a little confused.
I now understand you clearly and am working toward achieving the goals we spoke of.
from advanced-sidebox.
Related Issues (20)
- Script Definitions: Add Property To Toggle Display for Mobile
- Test On Popular MyBB Themes HOT 12
- Add/Edit Sidebox: Custom Title Not Displayed
- Add/Edit Sidebox: Scripts List Loaded Incorrectly
- Manage Scripts: Error On Update Width Redirects To Wrong Page
- Slideshow Module: In 3.x Error Caused By Deprecated jQuery
- Slideshow Module: JavaScript Update & Added Features Start
- Addons: Standardize Minimum Module Version
- Standardize capitalization in module descriptions.
- Manage Sideboxes: Show module description as title text on module `div`s.
- Filter Boxes Before Column Checks
- Expand sidebox HOT 4
- Creating non master scripts doesn't work HOT 1
- Dragging script seems to malfunction HOT 1
- Portal default "Replacing entire template?" setting HOT 5
- Getting module data or information HOT 1
- Getting xthread data for last threads. HOT 1
- Incorrect integer value: '' for column `mybb`.`_asb_script_info`.`mobile_disabled`
- Title of the custom boxes below their contents
- Left Sidebar breaks threads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advanced-sidebox.