Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Addon Module Settings #22

Closed
WildcardSearch opened this issue Jan 27, 2013 · 15 comments
Closed

Rework Addon Module Settings #22

WildcardSearch opened this issue Jan 27, 2013 · 15 comments
Assignees
Milestone

Comments

@WildcardSearch
Copy link
Owner

After much thought I think it would be best if each addon module just provided information to the core and allowed control of install/uninstall/is_installed/upgrades/etc be controlled by the core.

For instance if settings and templates were provided as associative arrays in the _info() function of that module then the core could handle making sure the module is installed properly.

In the end (before/when 1.4 is released) I'd like each sidebox to get a copy of it's parent addon modules settings that can contain completely separate values per side box.

I'd also like to add versioning, author info (link too) and built-in upgrade functionality to the addon modules.

Thoughts are welcome.

@avril-gh I have already made a little progress with this and while it will require a little restructuring of your Online Staff addon module I think you will be able to see why it is better.

I have made some changes to your module but no functionality has been changed at all. I am only reformatting the templates and settings.

@ghost ghost assigned WildcardSearch Jan 27, 2013
@avril-gh
Copy link
Contributor

You could make a 'feature' or 'alpha' branch (or any name you like and find descriptive)
which would be development / testing / ect branch.

While 'master' is default release branch, and its shown when someone enter project page,
and from where everyone download release version by 'download button',
other branches are not shown to them by default, and are meant exacly for this purpose
('unreleased work in progress / development / testing stages ect)

So we would work on this 'feature' (or whatever called) branch, test things before release,
preview, discuss, push to it, fix, ect.
and if you decide its ready to be officialy released as stable new version, then you could simply merge
all changes from this 'feature' branch onto master, bump version number and simply delete 'feature branch'
as no more required.

Would be more easy, clean ect to work this way than pushing everything to master,
to find later that official release have bugs, unfinished features or even leaked stuff which shouldnt be there,
(after - many people downloaded it and installed as official release... like these unfinished experimental modules
code in 1.3.4 which should never be released at all)

After all its the way how most collaborating projects work.
They have at least 2 branches - 'master' (as official release),
and 'feature' as (unreleased work in progress version where everyone push, test, ect
before its merged into release (master)

That could give addons authors (like me) chance to fix modules,
giving you same time less work, and more time to concentrate on core,
plus possibly introduce some ideas or solutions to project as a whole, when seen from all sides.

@avril-gh
Copy link
Contributor

Oh, providing 'unnoficial work in progress' branch would be cool not only because i would have chance
to make module compatible with new core but maybe even it would give me ideas what can be made better
because of changes in core.

@WildcardSearch
Copy link
Owner Author

I agree with everything you said but I am not sure I know how to make that happen. I will try to get a new branch created and push 1.4 to a 'feature' branch so that we can begin testing on it.

I am so close to having 1.4 working with these following changes:

Added settings to each side box and changed the way modules create templates and settings. Modules now provide associative arrays for necessary templates and settings. The templates are installed by a new Sidebox_handler class object and versioning has been added to addons as well as upgrade functionality in the core so the addon author doesn't have to maintain installation, but rather give information to the core for that purpose.

The version info is stored in the cache and

Also addons received a author and author site property so that we can keep the descriptions clean while still providing support links and crediting addon authors.

Side boxes now have group permissions attached by default. The code considers all of the member's groups and displays/hides sideboxes accordingly.

Created a Sidebox_custom class to handle custom static boxes.

Reworked side box editing routines to be a little more convenient in specific script filter views. ie. attempting to predict which scripts the box will be intended for by the current script view filter.

Upgrade script updated to handle step up to 1.4

I still have to handle creating some default settings for addons that were created in earlier versions so they will work without uninstalling.

@avril-gh These changes mean that in the future you can add/delete settings/templates and not have to worry about leaving trash behind when you upgrade AND no one has to uninstall anything when they upgrade-- just overwrite the addon modules files and the core will automatically upgrade the module if the version has increased (cropping any old settings and templates and updated the rest)

I am certain there will be many bugs in this version so your idea of a feature branch is duly noted. I may try to get it done tonight, but only if I can straighten out the upgrade script tonight. I wouldn't want even the beta to be unable to upgrade without uninstalling it.

I am really close though 😃

WildcardSearch pushed a commit that referenced this issue Jan 28, 2013
At this time upgrading doesn't work fully and some side boxes may need to be edited and resaved in order to function properly. I should be able to work this out in a few days hopefully.

I am addressing Issue #21 and Issue #22 in this update.

This version is NOT READY FOR A LIVE FORUM. I can not stress that enough.
WildcardSearch pushed a commit that referenced this issue Jan 28, 2013
At this time upgrading doesn't work fully and some side boxes may need to be edited and resaved in order to function properly. I should be able to work this out in a few days hopefully.

I am addressing Issue #21 and Issue #22 in this update.

This version is NOT READY FOR A LIVE FORUM. I can not stress that enough.
@WildcardSearch
Copy link
Owner Author

Okay I think I have done it.

If I have made any errors feel free to correct them.

As to the changes to your module we can handle them anyway you like. It is your work and I only edited it to give you an idea what changes need to be made and also to use it for testing.

A Known Issue:

Upgrades leaves so sideboxes dysfunctional until they have been edited/resaved . . . this will be resolved as soon as I understand it fully.

@avril-gh
Copy link
Contributor

Oh, cool. Thanks.

  • updated my repo to work on branches.

Btw, you should remember to update MyBB Mods section, because if not,
then people continue to download old version and then asking what do do with it.

@avril-gh
Copy link
Contributor

Have not checked yet into code but just installed the beta and...
First impression is - wow, very nice, options are now bound to module.

Good work 👍

...Ok, goin back to look into it.

@WildcardSearch
Copy link
Owner Author

When you have time take a look at adv_sidebox/adv_sidebox_classes.php and the new class installed to handle custom boxes and the Sidebox_handler class as well. If you look closely you can see that I have set things up to implement your idea of each module returning content (instead of eval()ing) . . . when that is done then we can go back to our discussion about whether to show modules that didn't contain content and whether an ACP setting is warranted 😉

I hope you like it and I am anxiously awaiting your approval :D

Btw, you should remember to update MyBB Mods section, because if not,
then people continue to download old version and then asking what do do with it.

I replied to the thread on MyBB about that. I want the new version to be on the mods site, but it takes two weeks sometimes for it to get approved and some people don't like downloading from GitHub.

And if I had sent 1.3.6 to the mods site it might still be awaiting validation and we would have never received the bug report for the latest threads module.

So like I said on MyBB, if 1.3.7 holds up for a couple of weeks and no bugs surface then I will update ASB at the mods site to 1.3.7 . . . if another bug shows up we will just keep testing and wait.

That seems best to me, what are your thoughts?

@avril-gh
Copy link
Contributor

but it takes two weeks sometimes for it to get approved

I though that it get long time only first time on initial submit,
and when its allready approved then updating it no need to be approved again ?

I hope you like it and I am anxiously awaiting your approval

I love it, ( print_r'ingit just now, lol)

...but just wondering Manage Modules tab is not finished ?
It just drop empty page with errors when try to display page with list of modules.

@avril-gh
Copy link
Contributor

...but just wondering Manage Modules tab is not finished ?

...ah found it...
Theres a bug which make Manage Modules tab fail.

in acp_functions.php line 750 instead of

$modules[$this_module]->build_table_row($table);

should be

$adv_sidebox->addons[$this_module]->build_table_row($table);

and the same bug 3 times in a row in next lines
but when fixed it works ok... nice nice 🙋

@WildcardSearch
Copy link
Owner Author

Oops I don't know how I missed that. I can clear that bug up this evening.

Thanks for the input.

@avril-gh
Copy link
Contributor

Oops I don't know how I missed that. I can clear that bug up this evening.

You forgot about feature branch 📄

allready fixed @c1d42c6af0b3695f7a2a67d5f39e5925bd1efaca hehe~
#24

@WildcardSearch
Copy link
Owner Author

Yes I am need to all of this collaboration, but I must say you have been a pleasure to work with so far.

Thanks so much for your hard work.

@WildcardSearch
Copy link
Owner Author

I think we can call this done and if a bug pops up just start a separate issue.

@avril-gh
Copy link
Contributor

avril-gh commented Feb 2, 2013

I think we can call this done and if a bug pops up just start a separate issue.

Agree.
Especially while it turned into spaghetti and i was no more sure what is this issue about.

@WildcardSearch
Copy link
Owner Author

It was about moving settings from the ACP -> Config -> Settings menu to individual side box settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants