Closed (fixed)
Project:
Flag Lists
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2012 at 11:19 UTC
Updated:
21 Nov 2014 at 14:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bachbach commentedHi,
here is a patch against flag_lists 7.x-1.1 which provide compatibility with flag 7.x-3.0-alpha2
update for flag 3.x
- table flags becomes flag
- replace all content_type and content_id by entity_type and entity_id
- changed flag_lists.install (new rows name entity_type & entity_id) and flags table name become flag
- factory_by_content_type('node') became factory_by_entity_type('node')
- flag_lists.views_default.inc (entity_id & entity_type)
because some tables columns are renamed, you have to uninstall and re-enable flag_lists module.
OR rename these tables columns :
flag_lists_content & flag_lists_counts : content_id and content_type become entity_id and entity_type
flag_lists_flags : content_type become entity_type
Comment #2
jyee commentedFlags 7.x-3.x branch changes flags to be fieldable entities, so Flag Lists should probably be rewritten/reworked in its own 7.x-3.x branch instead of patched to keep working as it does.
One simple way to create flag lists with Flags 7.x-3.x is to add a "list" field to the flag (via flagging form module).
Comment #3
reptilex commentedjyee I raised that issue in flags and was told that flags will not be made to entities. What has been made to entities are flaggable items, this means the setting of a flag is an entity, so each "flagging" not the flag for which you are flagging. As such flag lists is still relevant and I would welcome very much the patch in a flag list 3.x version.
Comment #4
jyee commentedFlag lists are still relevant, but the method in which they should be implemented should be very different. Flaggings are entities, Flags are bundles... My apologies for the previous, misleading comment above. However, the statement still stands. Since you can add arbitrary fields to the Flag bundles, Flag Lists should be reworked to make use of entities and the native Drupal field api. Doing so would make Flag Lists better integrate into other Drupal projects, e.g. exporting via Features.
Comment #5
reptilex commentedAn implementation of flag_lists with entities would be great. Have you got an idea how long this would take? Sadly I'm not familiar enough with entities to start that on my own, but I would be very glad to help.
Comment #6
queenvictoria commentedI've rerolled this patch with the change to hook_flag_link_types (to hook_flag_link_type_info here).
I've incorporated this patch also https://drupal.org/node/1935334
Comment #7
queenvictoria commentedRe comments #4 and #5 above. @jyee could you outline in a little more detail what would need to be done to re-write this? Its on my plate at the moment and although, like @reptilex, I'm unfamiliar with how entities work under the hood, it looks like it might be time to learn.
Also how does one go about creating a 7.x-3.x branch for this module?
Comment #8
queenvictoria commentedI'm going to carry on fixing this version over at github. I'd still love to hear about a better way to port this module to 3.x and create a branch at D.O. if anyone can throw me some pointers.
Comment #9
jyee commentedI don't have time to write the implementation, but the way to do it would be to generate an entity using hook_entity_info that would be a flag list. The module would then add an entity reference field to flagging entities so that each flagging could be associated with a user's list. Views would be used to display a users list of flaggings grouped by flag list.
Comment #10
queenvictoria commentedI was thinking of writing something custom in that direction but then I thought it better to build on an existing structure (Flags for example). Is that model what Flags does internally? Entity ->>> many EntityReferences? Does this move away from extending the Flag module?
Comment #11
bachbach commentedhi all,
following my initial post here is a new patch to assure the compatibility with flag 3.2
patch flag_list with #1 and then with this one
sorry, since i don't use views anymore, i didn't try #6
Comment #12
kevinquillen commented'flags' table is now 'flag' which breaks a lot of the code in the stable release. Should probably at least get those fixed and released.
Comment #13
queenvictoria commentedI've been working on a fork of this to get it up to flag 3.x. But its not on D.O at the moment. There were a large number of changes that I needed to make to get it working well. I've not implemented the suggestion in #9 by @jyee however.
Comment #14
kyletaylored commentedI went ahead and rerolled patch in #6 to work with #11.
So basically use patch #1, #6, then #14.
Comment #15
awolfey commentedIf anyone wants to be added as co-maintainer please let me know. Unfortunately I don't have time for this project anymore.
Comment #16
Anonymous (not verified) commentedCan't get it to work with flag 7.x-3.3
Best regards
ArchGalileu
Comment #17
tomdisher commentedSo is this project dead in the water or is someone planning on updating to flag 3.0 officially? I can't contribute much coding at the moment but would help with testing if needed.
Comment #18
sl27257I also need this one... Not desperately yet but it might soon be :)
I didn't manage to #1812326-14: Flag 7.x-3.0 compatibility to work. I.e. to get all patches to be accepted in that order that is proposed.
Anyhow I like the idea of #1812326-9: Flag 7.x-3.0 compatibility
I have started to try to get something to work but it would be nice to get access to the work mentioned in #1812326-13: Flag 7.x-3.0 compatibility in order to have something to play with which has more done then what I currently have...
Comment #19
stefank commentedHi All,
I needed the module to work with the latest stable version of flags 7.x-3.5, so I've added all the patches from this and other posts to make a one(slightly big) patch. I done tests, and everything looks and works as expected. The patch also includes some code styling fixes.
The patch should apply to dev version. Did not test with the stable version 7.x-1.1.
Comment #20
stefank commentedMaybe it can be done as branch 2 of flag lists module.
Comment #21
sl27257An flag_lists.admin.inc interdiff. There is more to do because some things don't work yet.
Comment #22
sl27257I now have a version here where most of the stuff seems to work. It would be nice if I could upload it to the dev-track, please...
Some caveats however:
The easier way is to wait for someone (me :) ) to fix the upgrade path.
Comment #23
jay.lee.bio commentedHi guys, thanks for all the work done so far. After applying #19 & #21, I'm happy to report that the module seems to at least start working. What I think needs to be fixed next is getting the link to create a new list to actually show up for users. I made sure to check all options in the block settings, but the block only shows the add links so far and not the create links. I've attached a couple of screenshots for reference.
Comment #24
sl27257Hi, Jay Lee, may I ask you if you have the views module installed? From what I can see the flag_lists behaves differently depending on if you have it or not. I have done all my fixing with views activated.
I had a request for my verison mentioned in #22 so I have attached a full dev version. I know this is not the way to do it but the size of it is smaller than the diff.
I see a install problem with this version. It might complain about a failed #7000 database upgrade. I have not checked why yet.
Comment #25
gearmonkey commentedJust installed the new version. Installed without error but was unable to get the "Add to you..." text to appear as a link. Discovered I need to change the configure field to "Javascript toggle" for it to display correctly.
Once that problem was solved, I came upon another. When I click on "Add to you..." I receive the error message
"You are not allowed to flag, or unflag, this content."
I checked all the permissions and they appear to be correct.
Thoughts?
Comment #26
sl27257Hi, there seem to be more thinks to fix :)
I work for me here... :)
I wonder if this have to do with that there is no upgrade path... Do you have views installed? Did you have flag_lists installed before? That is have you upgraded or did you do "fresh" install?
/Thomas
Comment #27
sl27257Hi gearmonkey,
I have found a few more paths that need to be updated. But let try to find your problems first:
1) The path to where you changed the "Javascript toggle", please!
2) There are (at least :) three places where the access must be set:
/admin/people/permissions#module-flag
/admin/people/permissions#module-flag_lists
/admin/structure/flags/manage/fl_template (Under flag access)
I assume you found all of them?
/Thomas
Comment #28
jay.lee.bio commentedSl27257, I finally got the link to create a new list to actually show up for users. For the newbies, here's what I did this time (steps 1 & 4 are important, as I remember eventually getting an error message when I tried to do step 4 at #23):
1) I installed the new version (#24) on one of my (almost) blank test websites with Flag & Views.
2) Enabled the "Lists" & "My lists" blocks (I just noticed that there are two of them, which I think is not important at this time).
3) Double-checked that all three options were checked per All Options Checked.png (#23) in the "Lists" block.
4) Under /admin/structure/flags, I enabled the "fl_template" (under "DISABLED FLAGS"), checked at least one content type under "Bundles" & filled out the two default messages under "DISPLAY OPTIONS".
Now if I go to any node that is of the content type that I just checked, I get to see a link called "Make a new list". I attached a screenshot for reference.
The next problem that I think needs to be solved is the error message that I get after I type the title and save:
"PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_type' in 'field list': INSERT INTO {flag_lists_flags} (pfid, uid, entity_type, name, title, options) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => node [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => Awesome Tracks [:db_insert_placeholder_5] => a:15:{s:10:"flag_short";s:48:"Add to your [flag_lists:title] [flag_lists:term]";s:9:"flag_long";s:58:"Add this post to your [flag_lists:title] [flag_lists:term]";s:12:"flag_message";s:69:"This post has been added to your [flag_lists:title] [flag_lists:term]";s:12:"unflag_short";s:58:"Remove this from your [flag_lists:title] [flag_lists:term]";s:11:"unflag_long";s:63:"Remove this post from your [flag_lists:title] [flag_lists:term]";s:14:"unflag_message";s:73:"This post has been removed from your [flag_lists:title] [flag_lists:term]";s:18:"unflag_denied_text";s:0:"";s:9:"link_type";s:6:"toggle";s:6:
"weight";i:0;s:13:"show_in_links";a:10{s:4:"full";s:4:"full";s:6:"teaser";s:6:"teaser";
s:3:"rss";i:0;s:12:"search_index";i:0;s:13:"search_result";i:0;s:27:
"entityreference_view_widget";i:0;s:5:"token";i:0;s:6:"custom";i:0;s:8:"custom_2";
i:0;s:8:"revision";i:0;}s:13:"show_as_field";b:0;s:12:"show_on_form";i:0;s:13:
"access_author";s:0:"";s:20:"show_contextual_link";b:0;s:4:"i18n";i:0;} ) in flag_lists_insert() (line 1346 of /home/my_website/public_html/sites/all/modules/flag_lists/flag_lists.module)."
By the way, you'll find the "JavaScript toggle" option towards the bottom of the page when you click the "+ Add flag" link (/admin/structure/flags/add) from /admin/structure/flags.
P.S. Like I said at step 1, I tried this on one of my test websites that's almost blank. Views was already installed, but this was the first time I installed Flag & Flag Lists. I also double-checked permissions at the three places (#27), although they shouldn't matter as I did all the testing as User 1. If anyone was able to actually make a new list, I will gladly try this again more thoroughly on a completely new test website.
Comment #29
sl27257Hi,
thanks for your comments!
I have found two incorrect links that are build by the flag_lists module. These make any empty screen showing up instead of the correct view.
The main problem is as you mentioned the error message at the end. I know what causes this... I have changed the table-names to entity intstead of content to adhere to Drupal new standard. I am currently working on an updated install file that do the update work. Until then unfortunately it is hard to succed.. I did those update by hand and that is why it is working here for me. Give me a few days and I will fix it...
Thanks so far!
/Thomas
Comment #30
jay.lee.bio commentedThomas, I'm just glad I finally got it working to where it should be. I've been wanting to use this type of module for months if not years, so I'll be the first user when it's stable enough. Take your time with the fixes, and I'll help you test them in a timely manner.
Comment #31
sl27257So here we go again...
I have now fixed the install file. Updating of the database was easy, however updating of the view was tougher.
Here is the procedure I used to update to flag-7.x-3.x: (It is the standard Drupal procedure BTW)
Some comments:
Good luck!
/Thomas
Comment #32
jay.lee.bio commentedThomas, I just did a quick test and I'm happy to report that it actually works! Here are what I think are the next steps:
1) You should be accepted as a co-maintainer.
2) #31 should be commited.
3) We should all start testing it more thoroughly to get an alpha version out.
I'll do more testing myself this weekend with a backup of my live site that has real data. After that I'll also write a couple of blog posts to help newbies understand why this module matters. One will use a real example using Flag and the other using Flag Lists.
Thanks to everyone for a job well done so far. Let's keep the ball rolling!
Comment #33
jay.lee.bio commentedComment #34
gearmonkey commentedFresh install.
Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'theatrework.flag_lists_content' doesn't exist: SHOW INDEX FROM {flag_lists_content} WHERE key_name = 'fid_content_id_uid_sid'; Array ( ) in db_drop_unique_key() (line 2930 of /var/www/vhosts/example.org/includes/database/database.inc).
:-(
Comment #35
gearmonkey commentedGot it installed... manually created the databases.
So far only one white screen "admin/structure/flags/lists/list"
Now that I have it installed, I don't have a clue as to how to use it. I followed the documentation below:
At admin/build/flags you will see a flag "fl_template." This is a default template flag provided by flag_lists.
+++++ Enabled.
You can edit it to make changes to list messages and to assign it to node types. This template will be used only on types you assign.
A template can be assiged to many node types, but a node type can only have one template assigned to it.
+++++ This doesn't appear to be true.
Enable the "list" block so that it is displayed on your content.
+++++ Done and specific path added.
The block will only be visible if the content is listable and the user has permission to create lists.
+++++ Checked and double checked permissions. They are set correctly. Listable?
That is, the node type must be assigned a template, or the block won't appear.
+++++ Entity Bundle? Yes.
Further, you should enable the link to create lists in the block's config.
+++++ Not sure what you mean here. I changed the 'Link Type' to 'Flag Lists toggle'. After doing that, the links in my view where no longer links.
Create new lists using the link in the block.
+++++ Never saw the link block.
How about a step by step, including recommended Field Types etc?
Thanks for all your hard work!
Comment #36
sl27257Regarding #34 I am very confused :(
The only place where db_drop_unique_key() is explicitly called is in flag_lists_update_7302. According to
http://drupal.stackexchange.com/questions/36011/hook-update-n-is-not-run...
hook_update_N is ONLY called when upgrading and NEVER when doing a fresh install...
Do you have any more details what you did, please?
/Thomas
Comment #37
gearmonkey commentedI wish I had more to tell you Thomas. I ended up copying the sql out of the install and running manually. No big deal.
I really want to play with the module but can't figure it out.
Comment #38
gearmonkey commentedI was just reading and re-reading your instructions in some of the above posts and I noticed that I do not have the two default messages under display options.
Comment #39
sl27257(Continuing on #36)
I did setup a test to do a fresh install here and as a part of this I used the uninstall function. There where some bugs in it which I have fixed and commited localy here (except for removing the views, but that will be fixed later).
The fresh install worked as expected, the tables are created correctly without the PDO you saw in #34.
Note that in order to trigger a correct fresh install you must remove the flag_lists entry in the system table. If you don't do this you will end up doing an upgrade instead. The entry in system is not removed when you do an uninstall. If you dare :) do the following command in your favourite database tool, be sure to backup before!!!:
delete from system where name like '%flag_lists%';
Comment #40
sl27257I have asked both the current maintainers to become a co-maintainer. I am currently awaiting their answers.
/Thomas
Comment #41
jay.lee.bio commentedThomas, how should we proceed if you don't get any answers from the maintainers? I've done some more testing with #31, but don't know whether to post all questions here or create a new issue for each one. How about I just get started using 7.x-1.x-dev as the "Version" field and then change it to whatever it needs to be once you become a maintainer yourself?
Comment #42
kevinquillen commentedThe Flag ecosystem is rather unstable if you ask me. There are issues migrating from 2.x to 3.x as well as edge case bugs in Flag/Drupal core that make it difficult to use. If he has working patches and wants to maintain the module, I say let him have access.
Comment #43
sl27257Hi,
I have started the procedure outlined here:
https://www.drupal.org/node/251466
by writing this message 1 week and a half ago:
https://www.drupal.org/node/2372445
So on the coming Tuesday (23-Nov-2014) I will move the issue to the Drupal queue.
So it is slowly being solved...
/Thomas
Comment #45
jay.lee.bio commentedKevinquillen, can you be more specific? I'm not gonna be migrating since I'll just start using 3.x to begin with, but what do you mean by edge case bugs that make it difficult to use? I've tested the Flag module in the past and thought it was stable enough.
Comment #46
kevinquillen commentedMainly this epic thread:
https://www.drupal.org/node/1925922
I get this error with Flag 3 more often than I'd like, but as you can see the root issue is hard to track down. But when this is triggered, it is exceptionally difficult to recover the site from WSOD hell.
Comment #47
jay.lee.bio commentedThanks for the link. But since we're trying to focus on using Flag with Flag Lists here, can you tell us if you're getting this error randomly, or when you try to do something related to Flag Lists?
For example, Flag can be used to create a "Wish List" & Flag Lists can be used to create a "My DVD Wish List". Do you think you'll get the error when doing something like these, or most likely when using Flag with a bunch of other modules for something that's totally unrelated?
I think what's important is to start off with a basic test installation using just Flag & Flag Lists. This is what I'm currently doing to focus on the biggest problems first. Then once a stable version is ready, start adding more modules like DraggableViews & Flag Weights and go from there.
It's a daunting process for sure. I have noticed so many little things that possibly need fixing, that I'm not even sure where to begin. This is why I've been quiet here for the past few weeks. But hey, you gotta start somewhere. :)
P.S. I might start with a blog post comparing the main differences between Flag, Flag Lists & Nodequeue.
Comment #48
jay.lee.bio commentedKevinquillen, I just got the WSOD you're talking about. I'll try my best to figure out how to reproduce it and let the maintainers at Flag know about it, since I haven't seen anyone do that yet. You are right though. The problem's a weird bitch, giving me enough headaches at the moment...
Comment #49
jay.lee.bio commentedThe bad news is that I couldn't figure out how to reproduce the WSOD: https://www.drupal.org/node/2379553
The good news is that since I only got the WSOD just once, I was able to make a lot of progress with testing out Flag Lists.
Comment #50
sl27257Great that you have started to test Flag Lists 3.x!
Please file new separate issues for everything you find and tag them with 7.x-3.x-dev. Ideally we should now be able to close this thread as we have a dev-release to work with.
/Thomas
Comment #51
jay.lee.bio commentedOk, I'm changing the status to "Closed (fixed)". I've posted six new issues, which is everything that I can think of right now. I think an alpha version can be rolled out if most of them can be fixed.
Comment #52
jay.lee.bio commented