Posted by joachim on November 5, 2009 at 5:24pm
Jump to:
| Project: | Nodequeue |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
nodequeue_nodequeue_form_submit() updates the subqueue directly.
Other than that there's nodequeue_add_subqueue() but that inserts a record.
nodequeue_subqueue_update_title only sets the title.
This is probably a requirement for features module support (nodequeue gets a mention here #490462: List of Modules that would need export/import stuff).
Comments
#1
We have nodequeue_add_subqueue and nodequeue_save_subqueue_order(), so aside form the title what else would you need to save? You almost never need to update the reference and when you do, you can do so through a query to the DB. I'm open to ideas why that's insufficient.
Services integration for one form of exporting but for more discussion of import/export strategies, see #373174: Export and import capability for nodequeue .
#2
I don't really know how subqueues and queues work together, but when I do nodequeue_save(), that doesn't take care of saving the subqueue, does it? The comments say as such.
What if the name of the subqueue or somesuch changes? Or is that not relevant for subqueues?
#3
My point is that if I do
print_r(var_export(nodequeue_load(1)));I get this:stdClass::__set_state(array('qid' => '1',
'title' => 'My queue',
'subqueue_title' => '',
'size' => '0',
'link' => 'Add to my queue',
'link_remove' => 'Remove from my queue',
'owner' => 'nodequeue',
'show_in_ui' => '1',
'show_in_tab' => '1',
'show_in_links' => '1',
'reference' => '0',
'reverse' => '1',
'i18n' => '1',
'subqueues' => '1',
'types' =>
array (
0 => 'sponsor',
),
'roles' =>
array (
),
'count' => 0,
))
now if I makes changes and feed that back to nodequeue_save(), what happens?
What if I feed that to nodequeue_save() on a different site? Without $queue->add_subqueue, the test in nodequeue_save() won't make the subqueue, will it?
What I mean is that the current API is not symmetric.
#4
"What I mean is that the current API is not symmetric."
Well, you told it to save a queue, not a subqeueue. That's why we have code to save subqueues. Instead of complaining about this, perhaps you'd like to write the code to do all the tasks necessary for import/export?
#5
Which brings me right back to my original post:
Search the module for "UPDATE {nodequeue_subqueue}" and you'll see that there is no function that allows updating of an existing subqueue other than coming from the form submission. Hence, gap in the API.
I'm sorry if you feel I'm complaining. And the concept of subqueues vs queues still leaves me rather baffled -- I know they exist, still not sure what goes on with regular queues. I assume you already understand the API, I do not.
#6
I plan to document the queue, subqueue concept further as it seems to be a place where folks are unfamiliar.
UPDATE {nodequeue_subqueue}appears in the api function nodequeue_subqueue_update_title(), which is actually never called from anywhere -- it exists as an api function. See my comments in #1 for why I believe this is sufficient.Could you make a list of places where we provide api access to data that is changed via form submissions but not when changed programmatically? That would help improve the API. Thanks!
#7
"Search the module for "UPDATE {nodequeue_subqueue}" and you'll see that there is no function that allows updating of an existing subqueue other than coming from the form submission. Hence, gap in the API."
Subqueues have a unique qid, sqid, reference and title. I've explained how to change all of those values which can be changed, so I'm marking this as fixed.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.