Active
Project:
Drupal Commons
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2011 at 18:42 UTC
Updated:
19 Feb 2014 at 06:57 UTC
Jump to comment: Most recent
Although the Flag module has a stable 6.x-1.3 release, it would be great to upgrade to 6.x-2.0-beta5 simply for Features integration. Although it is a beta release, I have been exclusively using 6.x-2.x for well over a year and it hasn't bitten me as of yet.
Comments
Comment #1
ezra-g commentedDefinitely. I agree on going to Flag 2.x.
We're planning to release 2.0 shortly, but we should consider this for future releases. Thanks for the input!
Comment #2
cpliakas commentedExcellent. Glad this is on the road map. For now I will just be hacky and alter the Flag module's menu item to add hook_flag_access()-like functionality :-).
Thanks,
Chris
Comment #3
daggerhart commentedcpliakas,
Were you ever able to implement Flag 2 into DC? I'm faced with a similar issue and would appreciate any notes or thoughts you have on it.
Comment #4
cpliakas commentedNope, I never upgraded the Flag module to 2.x. Regarding the functionality I needed, specifically the access stuff added in 2.x, I was able to implement in a custom module via a hook_menu_alter().
Comment #5
ezra-g commentedThis came up as part of the work on #1392768: question and answers (Q&A) feature & Origins theme tweaks.
I want to be careful not to break things for upgrading sites.
In support of upgrading to Flag 2.x:
- The Flag 1.x branch is no longer the recommended release per the project page, and the last release from this branch was May 8, 2010, vs Sept 8, 2011 in the 2.x branch.
- The 2.x branch has actual exportable support, which is more suited to a distribution versus defining a flag object and saving it.
- By depending on the recommended branch of Flag, we make it more likely that QA will be installed as a standalone contrib outside of Commons
- All the improvements of Flag 2.x (eg faster DB schema, everything listed at http://drupal.org/project/flag)
- May simplify Drupal 7 upgrade path: - I can't tell from the issue queue if there is a direct upgrade path from 6.x-1.x to 7.x-2.x. We should find out from quicksketch.
Potential risks of upgrading to Flag 2.x, items in support of 1.x
- Will the Facebook-style statuses "like" a status functionality still work?
Apparently this hasn't been tested per http://drupal.org/node/682244, but is relatively easy to test.
- We'd need to re-export the Commons features with proper flag exports, though this seems like an acceptably moderate bit of work.
- Will the API changes break any functionality for sites that have build additional functionality on top of Flag? This is the biggest question in my mind. If the 2.x API differs significantly, that may be a reason to avoid upgrading.
Comment #6
cpliakas commentedGreat synopsis! Excited about the progress of this issue.
Comment #7
daggerhart commentedConcerning potential risk:
- Facebook status like does break when attempting to use Flag 2. I've tested that on a project I'm currently working on.
- Differences in the APIs are somewhat small by my analysis. I ended up backporting flag_term to API 1 for my needs and submitting it as a patch here http://drupal.org/node/1369600 . Most of the patching is loading the flag css and js files, the actual differences in the API seem fairly small. (btw: the patch needs a minor amount of work to prevent certain PHP notices in some cases)
I could look into creating a patch for facebook style status to convert it to flag api 2 if you would like additional help with this.
Comment #8
ezra-g commented@daggerhart Thanks for offering to help - that would be great!
We're still working through the decision here and will definitely post if we come to any conclusions. Patching FBSS would definitely help make it easier to update to Flag 2.x!
Comment #9
ezra-g commentedComment #10
quicksketchHi guys,
I'd highly encourage upgrading to 2.x just because it's the actually supported version. Despite being in beta, it's actually the version that is installed here on drupal.org. The changes we've made to indexes really have some significant performance improvements, and just about every other module that uses Flag has already been updated (and actually requires) Flag 2.x (http://drupal.org/project/flag_service) and Rules (http://drupal.org/project/rules) for example.
Regarding upgrading, I believe at this point you can actually upgrade directly from Flag 6.x-1.x directly to 7.x-2.x. However if code consistency between D6 and D7 is a goal for maintainability, you should use the same version of Flag in both versions.
Comment #11
ezra-g commentedThanks for the input, @quicksketch!
quicksketch and I chatted in IRC and he pointed out that there are some minor API changes, but it sounds like the most significant changes may be theme-related, since the way flags are themed changes from 1.x to 2.x.
Still, updating to the version of Flag that's actually maintained is a compelling argument on its own, even without the other reasons to update.
It sounds like the tasks to update in Commons would be:
- Provide Activity log support for Flag 2.x
- Export the "Bookmark" Flag as a proper exportable (seems this is the only place we actually use Flag within Commons)
- Remove functions that manually save the Bookmark flag, which are deprecated by the exportables.
Comment #12
ezra-g commentedcpliakas did some work looking into the specific relevant changes. Here's what he found:
Looking through the code, the arguments for the main theme function have
remained the same, some additional theme functions were just added on the
2.x branch.
flag_theme() 6.x-1.x
flag_theme() 6.x-2.x
The preprocess function and flag.tpl.php file have changed:
flag.tpl.php 6.x-1.x
flag.tpl.php 6.x-2.x
Comment #13
js commentedI am checking in for two reasons related to a new site and the requirement for an additional flag on a user.
1. To avoid issues later, can I, or should I use version 2 now?
2. I discovered that Commons unsets $account->content with $account->content = array()
Would this be the way to add a link back into the user profile?
(I am also wondering how to get a link to subscribe a user's content).
Comment #14
codesidekick commentedezra-g,
Is there any progress on this? I'm currently developing a moderation system for a commons site based on Flags and rules and would like to be able to use Features for deployment, Flag reset for resetting abuse reports and per-role unflag/flag permissions.
If there's any way I could help bring Flags 2 to Commons let me know what I can do.
Comment #15
japerryI'm thinking we probably should address this. And seeing that we're behind with Flag 2.x on DC 7.x-3.x, its only going to get more outdated for both versions.
Right now, commons 6.x-2.x will always show an error to update, because 6.x-1.x flag is unsupported. This could make life in the 7.x-3.x branch worse if/when the same happens with the 2.x branch.
On the otherhand, if we're making 6.x EOL soon, it might not be worth it. It really depends on how many people still use Commons 6.x-2.x.