Bug 6178 - tag cloud diff depends on where you click
Summary: tag cloud diff depends on where you click
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL:
Keywords:
: 2899 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-13 15:31 UTC by Nicole C. Engard
Modified: 2015-09-22 12:41 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
my tags tab (41.35 KB, image/png)
2011-04-13 15:31 UTC, Nicole C. Engard
Details
tag cloud (54.64 KB, image/png)
2011-04-13 15:32 UTC, Nicole C. Engard
Details
Bug 6178: Display tags from other users in all cases. (2.53 KB, patch)
2015-03-25 13:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 6178: Display tags from other users in all cases. (2.71 KB, patch)
2015-03-25 15:19 UTC, Marc Véron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2011-04-13 15:31:49 UTC
Created attachment 3907 [details]
my tags tab

When you click on 'my tags' in the opac you see a tag cloud under 'all tags' that is just your tags. If you click on 'tag cloud' you see the real cloud tags.
Comment 1 Nicole C. Engard 2011-04-13 15:32:16 UTC
Created attachment 3908 [details]
tag cloud

cgi-bin/koha/opac-tags.pl
Comment 2 Nicole C. Engard 2011-04-13 15:32:41 UTC
Comment on attachment 3907 [details]
my tags tab

cgi-bin/koha/opac-tags.pl?mine=1
Comment 3 Chris Cormack 2011-04-14 03:18:10 UTC
Right, so the bug is that it says all tags when it should say my tags?

Did it do this prior to template toolkit?
Comment 4 Nicole C. Engard 2011-04-15 01:08:04 UTC
No the bug is that all tags aren't showing. My tags is the list of tags, the tag cloud should be the 'tag cloud' - which includes all tags.  I don't remember what it said in the past, I just noticed this while training an thought I'd note it.
Comment 5 Owen Leonard 2011-05-20 15:20:32 UTC
When you click the "my tags" link the tags page is passed parameter, "mine=1." The page is supposed to display only the logged in user's tags. This is the query which is going on in the background:

	SELECT 	tags_approval.term          AS term,
			tags_approval.approved      AS approved,
			tags_approval.date_approved AS date_approved,
			tags_approval.approved_by   AS approved_by,
			tags_approval.weight_total  AS weight_total,
			CONCAT(borrowers.surname, ', ', borrowers.firstname) AS approved_by_name
	FROM 	tags_approval
	LEFT JOIN borrowers
	ON      tags_approval.approved_by = borrowers.borrowernumber
	WHERE approved = 1 and borrowernumber = [logged in borrower]

The problems with this is that it will always return no results: borrowernumber doesn't exist in the tags_approval table. It can only be found in the tags_all table.
Comment 6 Owen Leonard 2011-05-20 15:38:42 UTC
Proposed new SQL:

SELECT 	tags_approval.term          AS term,
	tags_approval.approved      AS approved,
	tags_approval.date_approved AS date_approved,
	tags_approval.approved_by   AS approved_by,
	tags_approval.weight_total  AS weight_total,
	tags_all.borrowernumber     AS tag_submitter
	CONCAT(borrowers.surname, ', ', borrowers.firstname) AS approved_by_name
FROM 	tags_approval
LEFT JOIN borrowers
ON      tags_approval.approved_by = borrowers.borrowernumber
LEFT JOIN tags_all
    ON tags_all.term = tags_approval.term
WHERE approved = 1 and tags_all.borrowernumber = [logged in borrower]
Comment 7 Owen Leonard 2011-05-20 18:16:44 UTC
I've tried to decipher Tags.pm but I'm failing. I think in order for this to work best we should just always show all tags, including the logged-in user if there is one. I can't see how to gracefully handle the presence or absence of a borrowernumber in get_approval_rows(). If we add tags_all.borrowernumber to the set of returned data we should be able to style the user's tags differently from other tags as suggested in Attachment 2637 [details] of Bug 2899 (of which this bug report is probably a duplicate when it comes down to it).

Assuming we can visually distinguish the user's tags from others I think that obviates the need to have a way to show only the user's tags.

Can someone else take a crack at this?
Comment 8 Nicole C. Engard 2011-05-20 18:56:18 UTC
I too think it should always show all tags - from all users. It's a tag cloud that's the purpose. And the logged in user can see his tags just by looking under 'my tags'
Comment 9 Owen Leonard 2012-02-17 14:27:40 UTC
*** Bug 2899 has been marked as a duplicate of this bug. ***
Comment 10 Owen Leonard 2013-03-26 14:38:26 UTC
This bug still exists in master as of 3.12 beta1
Comment 11 Jonathan Druart 2015-03-25 13:02:24 UTC Comment hidden (obsolete)
Comment 12 Marc Véron 2015-03-25 15:19:11 UTC
Created attachment 37221 [details] [review]
[Signed-off] Bug 6178: Display tags from other users in all cases.

At the OPAC, if you click on the "your tags" link, only you tags are
displayed in the tag cloud.

There is no sense to do that, the user's tags are displayed in the table
below.

Test plan:
Confirm that you see all tags in the tag cloud, even if you click on the
"your tags" link.

Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 13 Katrin Fischer 2015-03-25 21:31:52 UTC
Hm, I am sorry, but I see no difference in behaviour before and after the patch. I have 2 tags: der and das. One belongs to my user, the other to another user.
Both always show for me :( 

I also got some anapproved tags. My list of records shows all my tags - unapproved or not. The cloud only the 2 approved tags from my different users.

The other thing: I'd expect that if I set "Tags to show from other users" to 0 or empty, that 
a) the foreign tag goes away
b) that my selection sticks, but the pull down returns to 100 immediately

Could you take another look please?
Comment 14 Jonathan Druart 2015-03-26 08:58:01 UTC
(In reply to Katrin Fischer from comment #13)
> Hm, I am sorry, but I see no difference in behaviour before and after the
> patch. I have 2 tags: der and das. One belongs to my user, the other to
> another user.
> Both always show for me :( 

You have to click on the 'your tags' link (not 'Tag cloud'). The link is opac-tags.pl?mine=1 (note the param mine set to 1).

Without this patch, the views are different, with it, they are similar.

Please try again.
Comment 15 Katrin Fischer 2015-03-26 09:03:26 UTC
I tried both links - from the top navigation and the user account. Will try again.
Comment 16 Katrin Fischer 2015-07-20 06:13:28 UTC
Jonathan, 

I tried again, but I still spot no difference before and after.

>You have to click on the 'your tags' link (not 'Tag cloud'). The link is 
>opac-tags.pl?mine=1 (note the param mine set to 1).

Parameter does never appear for me in the URL, both links show as: 
http://localhost/cgi-bin/koha/opac-tags.pl

More so, there are some problems:
There seems to be no way to make the tags of other users disappear from the tag cloud, but the display looks like it should be working - for example setting the 'tags from other users' to 0. But when I save nothing happens and it reloads to show 100.
Comment 17 Jonathan Druart 2015-08-04 10:51:30 UTC
Katrin,
I think we are not understanding each others.
This patch only affect the tag cloud, not the table.
The mine parameter is *removed* by this patch. The idea is to display the same tag cloud, whatever you have clicked on "your tags" or "tag cloud" links.
I can confirm it works for me.
Please try again.

The problem you reported is just a wording issue: the limit just allows to restrict the number of tags displayed (no matter who has created them).
Comment 18 Katrin Fischer 2015-08-04 11:18:55 UTC
Hi Jonathan, I think the table and the other display appeared the same for me. The 'mine' pull down still showed... and I think I disagree with the idea :(
I think it should be possible to show me a tag cloud with only my tags.
Comment 19 Jonathan Druart 2015-08-04 13:05:16 UTC
(In reply to Katrin Fischer from comment #18)
> Hi Jonathan, I think the table and the other display appeared the same for
> me. The 'mine' pull down still showed... and I think I disagree with the
> idea :(
> I think it should be possible to show me a tag cloud with only my tags.

With C4::Tags as it is for now, it's impossible to introduce big changes.
IMO the tag cloud should display all tags, especially because the page says "all tags".

What is the 'mine' pull down?

Setting in discussion.

Nicole and Owen, what's your opinion on this one?
Comment 20 Katrin Fischer 2015-08-04 13:28:40 UTC
I think we are misunderstanding each other somewhere - I will try do make some screenshots soon. - also others taking a look is a good idea :)
Comment 21 Jonathan Druart 2015-09-22 10:30:46 UTC
Anybody around?
Comment 22 Marc Véron 2015-09-22 12:41:17 UTC
I just re-tested the patch. In my opinion, it does what is expected.

How I tested:

- Make sure that you have plenty of tags from different users
- Make sure you have a test user with just one tag (makes testing easier). Make sure this tag is approved in the staff client.
- Log out
- Go to OPAC ->Tag cloud

Result (without and with patch): All Tags are visible as cloud.

- Click link "Log in to see your own saved tags" or log in from home page and go to Tag cloud (in the top navigation)
Result: Without and with patch: Page displays the tag cloud and the list of test user's tags

- Click on link 'your tags' in the navigation at the left
Result:
- Without patch: Page cloud is not displayed (you have to hit OK near 'Tags to show...' to display it), the list of test user's tag is displayed.
- With patch: Page displays tag cloud and the list of test user's tags (it looks the same as if you click on 'Tag cloud' from the top navigation.

Opinion: I prefer the behaviour with patch (same behaviour from the link 'Tag cloud' at the top navigation as from the link at the left navigation ('your tags'). It feels more constant.

However, I would propose to change the wording of "Tags to show from other users :" To "Tags to show: ", because logged in user's tags are always included in the tag cloud.

BTW: Idea for an enhancement: Add css class to user's own tags e.g. to give them a separate color in the cloud?