Download & Extend

Abstract back-end for integration with 3rd party issue trackers

Project:Feedback
Version:7.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Will Feedback 2.0 intergrate with either Project or Case Tracker? It would be great if it did. I could filter Feedback 2.0 Ajax output into a casetrcker or project content type and use the functionality of those modules.

Please let me know.

Thanks,
chris

Comments

#1

Title:Will this integrate with either Project or Case Tracker?» Abstract back-end for integration with 3rd party issue trackers
Version:5.x-2.0» 6.x-2.x-dev
Component:Miscellaneous» Code

Yes, I already thought about this, too. However, the goal must be to abstract the current logic in a way that any issue tracking system can be used as back-end.

The one who will work on this issue should assign it to herself in front of doing so.

#2

This project integrates (sans API, natch) with Unfuddle via Jody @ Zivtech's Unfuddle/Feedback module: http://drupal.org/project/unfuddle_feedback

#3

Assigned to:Anonymous» greg.harvey

I think I will be doing a part of this this week. I intend to create a patch for this module allowing administrators to extend/edit the feedback fields which, in turn, will go some way towards allowing integration with other systems. Here's the plan:

  • Create a simple database storage mechanism for keeping multiple Feedback text fields
  • Extend the feedback table to capture responses to additional fields (if provided)
  • Create an admin mechanism for creating/updating/deleting/changing the order of Feedback fields (and corresponding data)
  • Allow administrators to select which Feedback field is the one shown under "Message" in the admin section (variable)
  • Move the current set-up (single Feedback field and text) to the "default" pre-installed setting
  • Update hook_install and hook_update_N accordingly

I was going to create a new table called feedback_fields, containing the following columns:

  • field_id (would use fid, but this could be confused with fid in the feedback table, which is "feedback ID" AFAIK)
  • title
  • type (only intend to add textarea for now, but will allow other types moving forward, e.g. hidden, text, date, etc.)

And also extend the feedback table with an additional field_id column storing which "message" belongs to which "field".

So, for example, if someone creates three feedback fields and a user enters data in all three fields, there will be three rows in the feedback table - one for each field. Each of these three rows will have the same values *except* message and field_id, which will be different for each row.

In Drupal 6 I doubt there's a huge amount of point in going much further than this, as when we hit Drupal 7 with this all the data will be able to be stored in the FieldAPI and the feedback_fields table will probably be immediately obsolete. So I'm doing this now to start the ball rolling and satisfy a client need, but it will be all change as soon as I start to play with the Drupal 7 version. =)

#4

Status:active» needs review

Made a start on this. See attached screenshot. Timely feedback welcome. =)

AttachmentSize
New admin screen for Feedback module fields 102.81 KB

#5

Version:6.x-2.x-dev» 7.x-2.x-dev

Thanks for working on this!

A couple of notes:

  1. Work on this and related issues should target D7 (HEAD), as it would be a über-major waste of time to introduce something like configurable fields for native/default Feedback entries/entities in D6.
  2. I agree that native feedback messages/entries (i.e. those the module provides now) should be using the entity API + made fieldable.
  3. This issue, however, is rather about abstracting Feedback's message storage, so as to allow to NOT store messages in Feedback's native "entity" but for example in a node instead, whereas "node" can mean integration with project_issue module, casetracker module, any configured node type, or whatever. Thus, it's not about configuring fields, but rather about configuring the target "entity" to use for feedback messages, which could even be a private message using privatemsg module. Therefore, it's about configuring the target entity, and along that way, about configuring something along the lines of a "field mappping" to specify how e.g. a project_issue node should be populated.
  4. Thinking ahead, this issue effectively means to
    1. either implement a mapping from Feedback's form to the actual target entity's data structure
    2. or to entirely replace Feedback's form with the form of the target entity, but (more or less) retaining Feedback's UI (which wants to be pluggable too; see other issue in the queue)

I hope I make sense, as I didn't think too long about this and related issues (yet). So feel free to argue for or against. ;)

#6

Hi,

You're welcome!

  1. Unfortunately, I must work in Drupal 6 for now, because I'm doing this on client time and it's a Drupal 6 site - there's no way I can start working on stuff for Drupal 7 on the client's clock. What I can do is effectively "prototype" things in Drupal 6, which will give me a good excuse to port it later. I do understand the wider community's preference for starting with the current dev Drupal and working back, but it doesn't sit well with commercial realities, e.g. it's impossible to spend any commercial time building something you can't use yet!
  2. Cool.
  3. I realise that, but I figured being able to control *what* is stored (e.g. control the structure of that data) would be the first step and then exposing it to other systems via an API of some sort would be the second step, if that makes sense?
  4. In the long run, b probably makes most sense to me.

Hope that helps, sorry I can't start on anything new in Drupal 7 until we have a Drupal 7 point release and we're doing client work with it. (Sadly I have too much "spare" time Drupal 7 work to do on the modules I already maintain to take on any more.) I'll have to continue on the Drupal 6 route for now. Do you want me to start a separate issue, or are you not interested in a patch at all? It seems to me it could work as a prototype for people to argue over, if nothing else. =)

#7

I see your situation and know that very well. I'm not entirely sure what exactly you need for your site, but it sounds like you need Feedback to store its data in a configurable and extensible entity, so as to allow to add further fields to its form/UI. If that is the case, the common denominator for this project and your site's use-case, already for D6, would be to

  1. Implement the pluggable storage (+ possibly mapping?). Configure the storage to use on a new settings page.
  2. Add a feedback_node module, which uses a(ny) configurable content type as storage. Status handling for each message can be deferred to another issue or perhaps dismissed at all and left to the site builder (to add field_permissions module + a checkbox/select to choose the status).
  3. Which allows you to use a certain node type for feedback messages, add arbitrary fields to it, and do anything else you want to do.

I'm still not sure whether we need the additional abstraction + field mapping. One one hand, it sounds convoluted and unnecessary, as Feedback could merely expose a UI for entering/sending feedback, regardless of entity. OTOH, I'm not sure whether we will loose possibilities if the entity form + storage is completely detached and unknown/uncertain for Feedback (e.g. what about BrowsCap integration; what title to store for nodes; etc).

#8

Ok, that all sounds sensible.

  1. Do you have any ideas for how pluggable storage might be implemented? I guess there'd have to be some sort of hook allowing third party modules to offer themselves up as a storage option for the Feedback module. I'll have to have a think about that. I guess there would be two available options with immediate effect, node storage (via feedback_node) and "basic" storage (built in?)
  2. On the subject of node storage, do you think $node->title can be used for message by default, or do you think it would be too short? I don't actually know what the limit is.

Re: field mapping, I still need to have a wider discussion with Alex Barth about that, as it keeps coming up and it's something I started to talk to him about a few weeks ago but needed to go away and collect my thoughts. In short, you may remember there was a sub-module of FeedAPI for mapping feed elements to CCK fields - this is now rolled in to Feeds. Which is a real shame, IMHO, as if it were a generic module it could be used in loads of instances, including this. So I think the abstraction of field mapping, both in and out of Drupal, should be managed by a separate module or modules, thus should be parked for now until I work out where I'm going with that!

#9

Just looking at the Unfuddle Feedback module NikLP posted above:
http://drupal.org/project/unfuddle_feedback

It just adds a submit function to feedback_form() - that seems like a good approach - just set the submit function according to the selected/available storage option(s).

Edit: Looking deeper, feedback_add_entry() is a far better place to do this. We could make a hook here.

#10

Here's an initial patch for adding the necessary hooks and admin pages to the Feedback module to allow other modules to provide storage mechanisms. Here's what I've done so far:

  • Added a new settings form at admin/settings/feedback
  • Added a new permission, administer feedback, for controlling access to settings
  • Added a new hook called feedback_storage, invoked from within the feedback_add_entry() function, allowing other modules to invoke their own storage mechanism
  • Implemented the new hook in feedback.module to provide a "basic storage" mechanism with the module (works as is)

I've also made a start on the feedback_node module too, but it's not usable yet, so no point in including it just yet.

AttachmentSize
293512-feedback_abstract_back_end.patch 3.82 KB

#11

Ok, this patch really does need review. This is an "alpha" version of the storage mechanism totally detached from the module. Changes from the last patch:

  • No unnecessary module_invoke_all() calls - switched to storing the module to be used for storage in a variable and using module_invoke() instead, since it silly to make the modules being invoked check to see if they should be!
  • Made feedback *viewing* happen by hook too, both on feedback forms and in admin
  • This now seems to work for the 'basic storage' option (see the new feedback_feedback_storage() function in feedback.module)

Look forward to getting your feedback on this.

Edit: Next task is to work on the feedback_node module, which will have its own implementation of hook_feedback_storage() and will also form_alter the feedback entry form to show any CCK fields on the feedback form. Also need to work out where we'll store the additional information - may continue to use the 'basic storage' mechanism from the main feedback module for user agent, page, etc. and store *additional* fields in a node.

(Btw, just realised, I've made a mistake and made this against 6.x-2.1. I don't know how much difference there is between that version and 6.x-2.x-dev at the moment, but I'll re-roll a patch against dev once this is all reviewed, if that's ok with you?)

AttachmentSize
293512-feedback_abstract_back_end_v2-D6.patch 9.67 KB

#12

Working on feedback_node.module is throwing up other issues, so there is a new patch coming. Just thought I'd let people know, in case they're reviewing. Feedback on #11 still valid though. A lot remains.

#13

Oh please do not roll patches against downloaded packages. We need a patch based on the CVS DRUPAL-6--2 branch.

Initial review:

  1. That $op argument pattern for hooks is a thing of the past. We want to use separate hooks like in D7, i.e.

    hook_feedback_info() (ex. type)
    hook_feedback_form()
    hook_feedback_load()
    hook_feedback_save()
    hook_feedback_view()
    hook_feedback_delete() (later)

  2. I'm not sure why actions are mixed into this patch. Can we remove those, please?
  3. Minor: Plenty of trailing white-space in this patch. ;)

#14

Thanks for the review! =)

Will split the hook out in to separate hooks, remove the actions stuff (dur, I wasn't thinking there!) and tidy up white space. On the white space thing, do you mean where an empty line has a double-space on it instead of being truly empty? That's Eclipse... will tidy up after it.

Next patch will be against a CVS checkout. Sorry about that. Good job it's a work in progress. =)

#15

As luck would have it it seems there's no difference right now between 6.x-2.1 and the CVS DRUPAL-6--2 branch, so I was able to just re-apply my code there as a patch. Here's a re-rolled patch again CVS.

  1. Hooks have been split out - they are currently:

    hook_feedback_storage() <- returns name and module for admin
    hook_feedback_storage_fields() <- add fields in to feedback_form()
    hook_feedback_storage_view() <- get feedback to display on the admin report
    hook_feedback_storage_load() <- get feedback to display in context in feedback_form()
    hook_feedback_storage_insert() <- save a piece of feedback

    Didn't bother with a delete hook yet. Current UI doesn't need it, as you can't delete feedback.

    Are the hook names you propose in #13 suggestions or instructions? If they're instructions, I'll use exactly your hook names. ;-)

  2. Removed!
  3. Tried to catch as much of this as I could - if I missed any, let me know.

Edit: Aside from potential hook renaming to apply conventions from elsewhere in core/contrib, this is probably nearly ready for commit. I think I will move over to #351698: Use entities for Feedback messages to post a patch adding the feedback_node module to the package. Otherwise this patch will become too big.

This patch should apply cleanly to DRUPAL-6--2.

AttachmentSize
293512-feedback_abstract_back_end_v3-D6.patch 11.41 KB

#16

Thanks!

  1. I think I'd prefer if we'd use the hook names I listed above. Not sure whether there can or will be other types of feedback "plugins" other than storage in the future. And even if there will be one, we can still rename them later, if absolutely required.
  2. For the administrative "view" of feedback messages, I don't think it makes sense to invoke a separate hook to display stored feedback messages within a generic callback. Instead, we should do one of the following:
    1. Entirely remove the administrative view and defer that to the pluggable storage implementation. I guess, especially for feedback_node, this would make sense, as you wouldn't need that separate list of feedback messages on Reports » Feedback messages (since you have the regular node content overview already)
    2. Similar to a), but keeping Reports » Feedback messages: Require hook_feedback_info() to also return a callback function name for that administrative overview page, which will be dynamically used in feedback_menu().
  3. Same basically also applies to the feedback form... a node form exposed via feedback_node would already contain a Submit button + stuff, which needs to be there. I guess that feedback_node_feedback_form() would fetch the entire node form of the selected node type, and more or less just display that with minor adjustments maybe (ensuring there is no "Preview" button aso.).

#17

  1. Ok, will rename (tomorrow), no problem.
  2. I prefer a) mainly because it's easier! feedback_node can just ship with a view. ;-)
  3. Ok, so we're saying rather than build half the form in the hook and half the form in feedback.module, ask the storage module to provide the entire form? That probably does need to be dynamically loaded in hook_menu, but I think that makes sense if I'm understanding you correctly.

#18

Ok, another new patch for review. Getting there!

  1. Hooks renamed. They are now:

    hook_feedback_info() (ex. type)
    hook_feedback_form()
    hook_feedback_load()
    hook_feedback_save()

  2. hook_feedback_view() has been ditched as it doesn't have a purpose for now.
  3. 'api version' has been added to hook_feedback_info() - always a good idea - now the admin form won't let you pick a module presenting code for the wrong API version - I went straight to '2' inline with the module version number. Made sense to me.
  4. The task of displaying reports on feedback has been delegated back to the module concerned with a dynamic hook_menu(), as suggested originally - this poses some problems (see below).
  5. Also added to hook_feedback_info(), and directly related to the dynamic hook_menu(), are 'report callback' and 'report arguments' - these are passed directly to 'page callback' and 'page arguments' in feedback_menu().
  6. If a module presents no callback function then no menu item is created, simply. (So it would be perfectly valid for a module to not bother to present a callback function and just provide a default view instead, for example - everything will still work.)
  7. Form building for the feedback user input form has been moved *entirely* to the hook_feedback_form() hook (not just a bit of it like before) so that hook is now expected to return a complete form array.

Problems/considerations

  1. Could not make a dynamic 'file' entry in feedback_menu() so had to move the admin view form and related functions to feedback.module - is there a way around this? If not, it simply means any callback function presented by another module must be in that module's actual file.
  2. I had to rebuild the menu tree on saving the admin settings form to make sure the dynamic hook_menu() implementation "sticks". Seems to work, but I don't know if there is a more elegant way? I copied how admin_menu does things.

Anyway, please review! I think we're really close this time. =)

AttachmentSize
293512-feedback_abstract_back_end_v4-D6.patch 21.14 KB

#19

Any further thoughts on this? Is the patch good to go, or is there a little more to do?

I'm running out of the window of time I'm able to work on this for, so it would be good to finish my work if someone has time to review. I'd like to write the feedback_node module next week, but want to make sure the API is accepted first! =)

#20

Can I use this to specify casetracker_basic_case as a node type?
I see only "basic storage" as an option. Is that true?

#21

Dang. I really need to get back to this issue and patch.

Actually looks pretty solid from a quick peek. Didn't test it and didn't totally think through the entire design though, and that's what takes a serious amount of time and/or confidence :)

Sorry, greg!

#22

Np, just let me know if you want me to do some more work on this. It's a pretty big patch/departure from the past, so appreciate you'll need the time to sit down and really work through things.

@SocialNicheGuru: I have started the "node storage" option, but have stopped working on it until this patch is in, because without this patch it cannot work. There will be a separate "node storage" module eventually, if this patch is accepted. Whether it forms a part of the Feedback project or has its own project page remains to be seen.

#23

Version:7.x-2.x-dev» 6.x-2.x-dev

#24

Version:6.x-2.x-dev» 7.x-2.x-dev
Status:needs review» needs work

At this point new features need to go into 7.x and we have new hooks now in 7.x that cover a lot of this work.

#25

Assigned to:greg.harvey» Anonymous

Unassigning, I can't see me getting time to work on this any time soon.

nobody click here