Would you be open to a patch that breaks out the DELETE, UPDATE and INSERT db calls from support_admin_client_submit() into their own functions?

My intention here is to integrate Support with Aegir, by sync'ing support_clients with hosting_clients, in a contrib module.

Comments

jeremy’s picture

Sure, sounds like a simple enough patch...

ergonlogic’s picture

Status: Active » Needs review
StatusFileSize
new9.67 KB

Cool, so here's a first pass patch. I've taken the liberty of refactoring support_admin_client_submit() to use a merge query, which avoids erroneous "update" messages.

Alternatively, feel free to cherrypick individual commits from: http://drupalcode.org/sandbox/ergonlogic/1269174.git/shortlog/refs/heads..., if you prefer.

jeremy’s picture

Thanks, I'll take a look at merging this after 6.x-1.5 is released (as I'm only intending to include bugfixes over the current rc1), hopefully tomorrow.

jeremy’s picture

Status: Needs review » Needs work

Looking at the patch quickly, I'm not seeing much benefit from this. Is your intention to be calling these functions directly in your own workflow?

It would be preferable to pass a single object or array that contains all necessary fields, rather than an obscenely long parameter string. It would also make sense to define pre and post execution hooks for each activity. While I'm not opposed to the idea, it's still not fully clear to me what will be gained.

jeremy’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Patch (to be ported)

Completely rewritten and committed in 6.x:
http://drupalcode.org/project/support.git/commit/3bf39a7

ergonlogic’s picture

StatusFileSize
new8.07 KB

Well, there's a morning wasted... oh well. Interesting to see how you implemented it. I didn't even know drupal_alter() existed.

bdragon’s picture

Status: Patch (to be ported) » Fixed

Rethought on Drupal 7.

I implemented Entity support for support clients.

Implementation:
http://drupalcode.org/project/support.git/commit/9aebab39a87826ad818b0e1...

Merge of 6.x commit (Changelog only):
http://drupalcode.org/project/support.git/commit/70180e9f8e4bbdac8441fe8...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.