Add to queue link does not appear unless remove link is present.

NikLP - March 23, 2009 - 18:40
Project:Nodequeue
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The UI for configuring a new NQ states that I can add a node to a queue using the link, if I assign text to that field. This should work without the remove field needing to be present, but currently it does not seem to be the case.

I created a NQ of length 1, for "current issue" - the idea being, that I can simply update to the latest issue of the publication on the website by using the "shove" functionality of the module - adding a new node to a NQ of length 1 will simply update this NQ to the latest issue.

In that use case, I have no use for a "remove" link, but I am forced to implement one otherwise the "add" link will not appear. As such, this is functionally different to what the UI says is possible and IMO a bug.

#1

ezra-g - March 28, 2009 - 15:44

This seems like a highly customized use case. One one hand I feel like this might be more appropriate for some custom code, but on the other hand, I would review a patch that separates these two pieces of text. Thanks for the suggestion!

#2

NikLP - March 31, 2009 - 10:23

Well, it might be a customised use case, but the UI says this is how it works already! Besides, I can think of plenty of occasions where the "remove" link would not be required. After all, if the queue is of finite length, stuff just "falls off into the bit bucket", which is of course automatic removal. The shorter the queue, (likely) the quicker the removal; so in any case like that, there's simply no need for a remove link.

I could of course theme the link out, but it seems a bit silly to do it that way. I'll certainly take a look if it seems I am having a good enough day to wade through the code! :)

#3

merlinofchaos - March 31, 2009 - 18:44

Nik is right, the remove link is supposed to be optional. AT one time it was, too.

#4

merlinofchaos - March 31, 2009 - 18:44

This is particularly good when you have a queue with a size of 1 and you don't want it to ever be empty. You don't ever remove an item from it, you just add a different item to it.

#5

ezra-g - April 2, 2009 - 17:06
Status:active» needs review

Here's an awesome 2 character change patch, which resolves the faulty logic that sets $queue->show_in_links to false (In the cvs annotation I didn't see that this was previously possible).

One thing to note is that when you add a nodee to a queue using an ajax link and no custom "remove" text is specified, the link turns into a remove link with the text of the queue. When refreshing the page, the remove link disappears. This seems mostly good, so that users can easily undo adding a node to a queue, but perhaps the default link text should include the word "remove" -- this requires further poking around probably in nodequeue.js.

AttachmentSize
411280.patch 694 bytes

#6

ezra-g - April 2, 2009 - 17:11

Actually, the change should be in nodequeue_title_substitute. We should probably make that function accept an 'op' parameter for 'add' and 'remove' .

#7

NikLP - April 3, 2009 - 10:04

I kind of changed my use case for this actually, so while we're on the subject...

The text there for those links applies to stuff in $links, and ALSO views fields. I decided that having the link there was too easy (in terms of possibility of error) so created a view with the links in instead. However, there's no option to prevent them appearing in the node display.

Is this something that could be easily segregated, or is it just too niche to bother with (in which case custom theming would be the way forward, I imagine)?

Thanks.

#8

NikLP - April 7, 2009 - 15:26

Ezra, are you wanting to patch the module again with respect to your later thoughts? I'm not sure whether or not to wait before making any changes - the site is "near live" as it currently stands.

Thanks.

#9

ezra-g - April 7, 2009 - 15:46

@NikLP, regarding your question in #7, are you saying that if nodequeue ajax link are not enabled when viewing the node, that they also don't display in the view field? If so that seems like a bug to me and deserves its own issue.

As far as improving this patch so that the 'remove' link text includes the word remove, yes, I'd like to see that happen, and it *should* be relatively straightforward. I'm somewhat confused by the logic, if (isset($_GET['tab'])) { in nodequeue_admin_add_node and the equivalent remove function. The sitewide tab setting doesn't seem to affect the link text here. @merlinofchaos, can you shed any light on what's intended with that logic?

Thanks!

#10

NikLP - April 8, 2009 - 14:00

Ezra, re #9 -> #7 : what I'm saying is, in order to use the text toggles in views, one has to set the values in the queue config, but this then automatically renders the toggles in the node view. I realised that it was too easy to make an error if the node toggles were available, but there's no way to turn that off. However, I can't use the views toggles independently. I'm not sure if it's possible to use (e.g.) a checkbox/radio setting in the queue config to determine whether or not the links are displayed in "plain" node view, views view, or both?

Does that make any more sense?! :)

I'm not sure what you mean by "improving this patch so that the 'remove' link text includes the word remove" - I think that makes it more convoluted in fact. Depending on one's use case, it might not be a "removal" at all - there's lots of funky ways to implement special case queues. The text should be completely configurable IMO.

#11

ezra-g - April 9, 2009 - 19:28
Status:needs review» fixed

Rather than let the perfect be the enemy of the good, I've applied this patch since it's such a simple fix. Please open a new issue for the bug involving displaying the nodequeue link in a view/on the node page -- I'd like to address that as a feature request, too.

#12

System Message - April 23, 2009 - 19:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.