Closed (fixed)
Project:
Flag
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Nov 2009 at 00:14 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchSounds good to me. This works with (or is similar to) Drupal 7's vertical tabs implementation too right? It'll be great to get a head-start on the D7 port with some compatible code. Thanks for sending the patch this way, it'll be a good enhancement and definitely belongs in Flag sooner or later.
Comment #2
dave reidYes, I believe this is at least very similar to the D7-style integration, just obviously without the module_exists() check. I'm working on an Integration handbook page for Vertical tabs for both D6 and D7.
Comment #3
dave reidYeah I think the only change would be this would use $form['#attached']['js'][] = ... instead of drupal_add_js(...).
Comment #4
dave reidSo even cooler news is we now support the #attached => js => array(...) in the vertical tabs backport. I'm also going to be adding #group property support to fieldsets to show which fieldsets should be tabified by default. So now with this updated patch there is nothing that needs to be changed when you port to Drupal 7! HOORAY!
Comment #5
dave reidMinor change in the attached JS key to match the D7 library name.
Comment #6
dave reidOh, and I lied. In the D7 port the actual JS will change a little bit. I'm working to see if I can backport those changes as well.
Comment #7
dave reidWorth noting that the flag summary JS was removed as of http://drupal.org/cvs?commit=299738.
Comment #8
dave reidAdding tag...
Comment #9
quicksketchI had to revise the patch slightly because it didn't make sense to add another flag.js file to flag (we already have one in theme/flag.js). Instead I added the code to flag-admin.js and pulled it in with the #attached property same as before. Committed to 2.x. Thanks Dave, sorry this took so long. :-(
Comment #10
dave reidHeh, no worries. I just felt bad because it got to the point where I had to remove it from vertical_tabs.module. :)
The only thing I have to add is I highly recommend adding a key of 'vertical-tabs' to the JS file in here. That way in-case another module needs to change the summary JS, they can easily swap it out (very edge case, but you never know).
Powered by Dreditor.
Comment #11
quicksketchThanks Dave Reid, I did modify that line because I wanted to follow the pattern set and used by Drupal 7 core. I don't see how using a key of "vertical-tabs" would help things though, wouldn't you want to key it as "flag-vertical-tabs" or something like that? I didn't even realize you could use arbitrary keys in #attached arrays, is there some kind of recommendation or standard on this?
Comment #12
dave reidThere isn't a standard on it yet. I came across this problem with pathauto needing to override the path.module fieldset summary:
I filed a patch for D7 but it hasn't had much traction and I haven't put much effort to push it either. This problem is going to be worse in D7 because in D6 we only support the #attached from the backport module. In D7 there could easily be more than one JS in a fieldset's #attached. If you have better ideas, I'd love to hear them in the core issue.
Comment #13
quicksketchAh, okay at least I can see what you're intending here. I was thinking we needed to namespace "vertical-tabs", but in fact it's explicitly stating "this is the required JavaScript for vertical tabs for this fieldset". It makes sense to me now. I've reverted the key change to match your original patch.
Comment #14
dave reidFYI #654894: Difficult to override a vertical tabs summary JS is the issue for Drupal core.