Closed (fixed)
Project:
Skinr
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
29 Oct 2010 at 15:05 UTC
Updated:
24 Jan 2011 at 08:20 UTC
Jump to comment: Most recent file
Revisit and clean up the existing "skinsets" code, which apparently is the desired functionality, merely obscured in an optional feature. The table in #68 proves that the existing functionality is almost identical to the desired functionality. However, lots of renaming and rethinking will have to happen here (although renaming and cleaning up stuff can also come later).
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | skinr-HEAD.api_.47.patch | 12.58 KB | sun |
| #44 | 965990-44.patch | 10.21 KB | jacine |
| #43 | combined.patch | 8.17 KB | phyadmin |
| #41 | skinr-api-docs-41.patch | 8.87 KB | jacine |
| #39 | skinr-api-docs.patch | 8.92 KB | jacine |
Comments
Comment #1
moonray commentedFirst stab at a patch. Needs a lot of work still.
Comment #2
moonray commentedHere's an updated patch.
Uses new skinr plugin file format. Still needs some clean-up work to remove old and outdated code. Skinr UI has barely been touched and still needs a lot of work.
Comment #3
sunThis patch should entirely ignore #956932: Determine optimal skin include file format and all other issues for now.
The goal is very focused: Turn current 'skinsets' into 'skins'.
Keeping their current syntax and structure, loading, and all other behavior. Potentially cleaning up related functionality, but not necessarily.
Comment #4
moonray commentedWe got rid of the loading of skinsets functionality, so really there's nothing much to do here if we're not going to approach this patch with our new file format in mind.
Comment #5
moonray commentedHopefully this patch will pass muster. There are a few minor assumptions made in this patch without which it a lot of improvement makes no sense, namely the fact that we're going to be looping through a set of hooks to retrieve our data. There is a @todo attached to that part of code.
Comment #7
moonray commentedToo many changes in skinr too fast. Re-roll.
Comment #8
vrajak@gmail.com commentedFor review should this just be tested that skinr works normally? or is there any particular test/review of functionality that should be done?
Comment #9
jacineIsn't part of the point of this to remove all references to skinsets? I still see lots of references to skinsets all over the place.
Comment #10
moonray commentedYes it is. However, skinr_ui.admin.inc contains too much outdated code that will have to be completely re-written (and therefore I didn't touch it except for changes to existing function names); that is where most of the remaining references to skinsets remain.
(for some reason d.o. won't let me upload patches at the moment, so it's forthcoming)
Comment #11
moonray commentedComment #12
moonray commentedComment #13
moonray commentedHere's an update that fixes several issues found in above patch by jacine.
Comment #14
moonray commentedHrm. let's try that without some of my testing code in it.
Comment #15
moonray commentedOK, found some more bugs and errors (css and js in skin options wouldn't load).
Comment #16
jacineOk, first off it's really great that Skinr is working again. Yay :)
At almost 100k, this patch is really hard to review, because there is no general summary of what was done. Please summarize the main points, or changes from the previous patch next time, so we can get through these reviews easier.
Here's my attempt at a summary (mostly for my own sanity – I want to make sure I understand), and my review of the patch.
Summary
Changed:
* See "Infos" below.
Added:
Removed
Apologies if any of the above is wrong. That's what I was able to grok.
$skin->skins
I realize that this is a @todo, but reading through the code it's really, really confusing:
Is there a reason why we aren't doing this now?
infos?
All references to "infos" in function names and variables is literally making me cry. It doesn't make any sense at all to me. "plugins" seems more appropriate in most of these places, and there are way too many theme functions here, no? I realize this is a work in progress and this will not be the final version by any means, but I think they all (#12-22 in changed summary) have to change. Also, the comment blocks for all these functions still refer to "skinsets."
Table on admin/appearance/skinr/skins
This table is way too verbose, and there are too many theme functions used to generate it. I realize we'll have to figure out how to better display this information, but in the meantime, the following tweaks should be made:
#theme => item_list__skinr.#theme => links__skinrand give it an .links & .inline class. Also, make sure you check if$skin_info['links'][$key]is set before doing anything with it.<h2>for the skin name.One last thing regarding that page... The default fieldset has no legend. It should be labeled "General."
Other comments
I don't get this. I thought they might be placeholders for functions you need to write, but
skinr_update_7200()drops both tables. Maybe you forgot to delete this?Drupal should be capitalized.
Do we really need this? I see you are using it twice in this patch. If so, shouldn't it be named more appropriately named as a helper function with a skinr prefix?
What about https?
We also need to:
skinr_overlay_widthandskinr_overlay_heightvariables in an update function.admin/appearance/skinr/settingsfromhook_menu().skinr_ui_settings().dialog_js_load()inskinr_ui.module.Comment #17
sunReviewed this *giant* patch. Didn't have the guts to go into all details, but overall, this patch looks like a huge improvement, code-wise. I'd recommend to commit it under the following premise:
*Lots of* follow-up patches that are going to revamp the API "anyway".
- Removed most of the .install file changes. Let's care for the upgrade/update path later on.
- $skin['_options'] and similar properties having starting with an underscore will have to be completely revised in a next step.
- Most of the added @todos are in line with the idea of major API rewrites "anyway".
- Some CSS classes that actually belong to Skinr module have been changed from "skinr" prefix to "skin" prefix. That'll have to be fixed in a follow-up patch. ("skin" is outside of the module's namespace.)
I understand that Jacine is probably not able to make much sense of the code just yet. However, I'd still recommend to commit this patch as-is anyway, but as said, only under the premise that we're going to heavily refactor the code afterwards.
Reasoning:
This patch doesn't really change the existing code. It merely renames a couple of functions and variable names throughout the module to comply with the terminology and ideas we came up with in the other "determine..." issue. So, in turn, trying to understand this code is the same WTF of understanding the current code, with the sole exception that with this patch, function and variable names are a bit more human-readable.
Comment #18
jacineOk, patch in #17 is committed in the interest of moving things along, but I still stand by all my comments in #17. :)
http://drupal.org/cvs?commit=456360
Marking needs work, so we can get to the next step. Please change the title to whatever that is accordingly. :)
Comment #19
moonray commented@todo Rename $skin->skins to $skin->options throughout the module.; we need to re-think the whole skin object.I've addressed all Jacine's other issues in the below patch.
Here's a list of all the @todos found in code (I've left out the ones from skinr_ui.admin.inc and skinr_ui.install since they need to be done later or elsewhere):
Comment #20
moonray commentedComment #21
jacineI'm fine with this patch except for the
_skinr_in_multiarray()function. It's better that it has been renamed but I find it odd to include in the first place. Seems to me that it would be better to just do the looping in place, but I'll leave that to others to comment on further. Marking "needs work" based on that for now.Comment #22
sunWe need to defer removal of that _skinr_in_multiarray() function until further clean-ups. As mentioned before, we're far from done with this issue yet.
Comment #23
moonray commentedLooks good. All the additions are good ones (but of course!). :)
Comment #24
jacineCommitted: http://drupal.org/cvs?commit=461516 :)
Setting to needs work, as the focus of this issue will now be on the handlers.
Comment #25
jacineThe patch in #22 broke Skinr. @moonray has a feeling that the modules/*skinr.inc files are not loading and therefore it's completely not functional right now.
Comment #26
jacineProposed fix from @moonray attached.
Comment #27
jacineHere's an updated patch.
Comment #28
jacineCommitted patch in #27: http://drupal.org/cvs?commit=462660
Comment #29
jacineNeeds work for API docs.
Comment #30
sunI do not understand this condition. skinr_module_load_all_includes() is invoked from skinr_init() only, and hook_init() itself is only invoked when Drupal reached full bootstrap, so all subsystems and modules have been loaded. Can we clarify what's happening here?
Powered by Dreditor.
Comment #31
jacineCan anyone clarify #30 for @sun, please?
Comment #32
coltraneIf skinr_module_load_all_includes() is only called from skinr_init() I also don't see why the function_exists() is necessary.
Comment #33
moonray commentedWe can get rid of the line in #30.
Code was copied from http://api.drupal.org/api/drupal/includes--module.inc/function/module_lo..., but I forgot to take that out (wasn't 100% sure about it in any case).
Comment #34
coltraneComment #35
moonray commentedLooks good.
Comment #36
jacineCommitted! Thanks :) http://drupal.org/cvs?commit=466110
Setting to needs work for API docs.
Comment #37
jacineHere's a patch for the docs.
Comment #38
jacineErr, Here's one without trailing white-space problems.
Comment #39
jacineForgot alter hooks.
Comment #40
moonray commentedI don't think this information is relevant. It's implied if it's part of a module or theme. The module or theme would never be enabled if it wasn't compatible with core, so the hook_skinr_api() hook would never be loaded anyway.
'the same' is repeated. It appears at the end of the line and again at the beginning of the next. This is the case with the description for both groups and skins.
Should hook_plugin_skinr_skin_info() be required? It's not in our default groups plugin in skinr core.
The sentence abruptly stops with the word "Instead".
Should 'class' be indented that far?
"will cause it to be enabled it by default"... there's an "it" too many.
Looks good otherwise. :)
Comment #41
jacineThanks! This patch should address all those concerns.
Comment #42
moonray commentedThis patch will need to be adjusted again, depending on what happens in #956994: Write load and parse code for Skinr include files in PHP format with the hook_skinr_api() function.
Comment #43
phyadmin commentedPatch given on 12/20 broken after patch
While the code in CVS isn't "working" right now, this is the only issue that is actually holding up the basic functionality: #956994: Write load and parse code for Skinr include files in PHP format, and it has working patches. I've got the one in #29 running locally to use for my themes: http://drupal.org/files/issues/patch_commit_4790e14e3753.patch
@ http://drupal.org/node/959686
applied. Fixed by taking added lines from that patch and applying them after the above patch. Here's the patch.
Comment #44
jacineHopefully this addresses all of @moonray's points in #42.
Comment #45
moonray commentedLet's commit this. The patch in #956994: Write load and parse code for Skinr include files in PHP format should then be responsible for making any alterations it requires in the api docs.
Comment #46
suns/plugin/PLUGINNAME/
All of the skin info properties specify more or less "defaults", so 'status' should be sufficient.
Actually, we should (or need to) move the "dynamic" (arbitrary) PLUGINNAME to a later position.
That is, because several namespace conflicts exist with having the plugin name directly after hook. The "plugin" of one module may clash with the module name of another module.
Simple example for a nameclash: Someone thinks that Skinr's default settings or whatnot are bad and thus creates the skinr_default module. The hook namespace for this module therefore is skinr_default, but Skinr module already contains a skin "plugin" that is named default, so we potentially have the identical function defined twice.
To prevent this, the pattern should be:
hook_skinr_skin_PLUGIN_info()
Powered by Dreditor.
Comment #47
sunHere we go.
Comment #48
jacineOk, committed. Thanks :)
Comment #49
sunI forgot to rename default_status into status, but we can also do this in #956994: Write load and parse code for Skinr include files in PHP format or separate issue.
Powered by Dreditor.