Closed (fixed)
Project:
Open Atrium Work Tracker
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 May 2014 at 00:32 UTC
Updated:
16 Jun 2014 at 20:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
scottalan commentedComment #2
dsnopekWorks with or without the linked PR, so I went ahead and committed it right away. :-)
Comment #4
scottalan commentedThanks dsnopek! I'm actually going to re-roll this per some comments from mpotter here: https://github.com/phase2/oa_core/pull/56#issuecomment-44280400
This will get rid of
strpos()and I also went ahead and added some caching. Granted, this is just in the defaultcachetable. I guess we could create our own cache tableoa_worktracker_cacheif you wanted to. If you think we should do that let me know and I can add it. For now, without an update, this will work. Let me know.Patch to follow...
Comment #5
scottalan commentedHere's the patch.
Comment #6
mpotter commentedThink there is a bug in this one. It loops through the command buttons looking for a worktracker button and unsets if any command button other than worktracker is found. So if you have a section that allows both worktracker and some other content type, the other content type will cause the worktracker to be removed. So the logic in this loop needs some work.
Comment #7
mpotter commentedComment #8
scottalan commented@mpotter
I'm pretty sure that's what it was doing before. This is for a select list that allows a selection of a 'Task Section'. If it's not a 'Task Section' then it is removed from the select list. Let me know if that's not right.
Comment #9
dsnopek@scottalan: No, Mike is right. The previous code removed sections that didn't allow creating 'oa_worktracker_task' nodes. This code will remove any section where the first content type on the list isn't 'oa_worktracker_task'.
Also, as I mentioned on IRC, the caching here isn't quite right. It will cache one global result, but the list of available Sections changes depending on what Space you are in. And the cache is never cleared - so, if a Section is added or removed, it'll never appear. Personally, I'd say just remove the caching from Work Tracker. If it's going to be cached anywhere, it should probably be inside
_oa_buttons_get_node_command_buttons()or higher up.Comment #10
dsnopekSince OA2 has a release comming up, I've implemented a simplified version of the patch in #5, which doesn't have the logic bug or the caching. I'm going to close this, but if we want to implement caching somehow, let's do that on a seperate issue!
Comment #12
scottalan commentedComment #13
scottalan commentedComment #14
scottalan commented@dsnopek Sorry, had a fix but didn't get it up quick enough. Looked back through the code an saw the bug you were talking about. On the caching...I agree it should be higher up. Thanks for the fix!