Closed (fixed)
Project:
Audio
Version:
6.x-1.x-dev
Component:
Views support
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2007 at 10:42 UTC
Updated:
7 Jan 2009 at 20:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
sgriffin commentedAny luck on this?
Comment #2
drewish commentedhere's a patch that should do it. you'll need to remove the existing sorts, clear the views cache (it's on the views tool tab), and re-add the sorts.
Comment #3
sgriffin commentedI believe you forgot to attach your patch! But thanks in advance!
Comment #4
drewish commentedright you are. and i can't even blame it on previewing now...
Comment #5
sgriffin commentedIt looks like its working.. but you must NOT make the field "Sortable", and use the default sort otherwise it sorts the same way.
Cool thanks, I think I can live with that.
Comment #6
sgriffin commentedHmm I did patch it, but it looks like it is not working after all. I see the patch was applied in views_audio.inc but the sort is the same.
On my working views, the audio nodes were luckily created in order.
Perhaps the patch didn't fully work? I have attached my inc.
Comment #7
sgriffin commentedHeres the inc. and the test site.
http://soundzabound.southern-digital.com/view_5_1_wtf?sort=desc&order=Track
Comment #8
drewish commentedit applied. as you pointed out though the table sorting won't work with this...
Comment #9
sgriffin commentedok, then how would you use the patch?
Or sort correctly with a table view?
Could the view module be altered itself?
This does seem to be an issue going back to 2005, I've found when searching. I could alter the views module, since I only use views for sorting by track.
Comment #10
drewish commentedscroll down to the bottom of the view edit form, you find a section for "sorts", try using that for sorting.
Comment #11
sgriffin commentedTrue, the metatag fields are not available there however.
I guess I could copy the track field into another field, and perhaps that would sort correctly.
Or be very careful and sort by node title which pulls in the filename... or that might only see !filename.
damn damn
Thanks for your help. I appreciated it.
Comment #12
drewish commentedwhat do you mean? "Audio: Tag *" are the meta data sort criteria...
Comment #13
sgriffin commentedUnder sort criteria, it shows a drop down list of cck fields, node created time, tax term, but...
I think I found something weird. The first option blank, but in the code.....!!
But as you can see the label is BLANK!
I wonder where this is going to take me.
Comment #14
sgriffin commentedoption value="audio_metadata_track.value" selected="selected"> "/option
Whoops tags stripped.
Comment #15
sgriffin commentedThat was it! Sorting by track on a table view is a big secret, due to the fact the label is blank! Crikey.
Comment #16
drewish commentedhere's a patch that gets the table sort working too.
Comment #17
sgriffin commentedHmmm that killed it, and gave my working view a mysql query error.
No offense, but I'm not going to touch anything again. :)
Comment #18
drewish commentedsgriffin, i understand your reluctance to continue testing this once you've got it working but i hope you'll reconsider. i've spent several hours on this this to help improve the module for everyone. i'd ask you to consider your time testing this patch as "payment" for my efforts. i'd like to get this committed knowing that it works correctly.
so, could you tell me what the error message said?
Comment #19
sgriffin commentedOk ok certainly. I did succeed in the file rollback. So I will update you momentarily.
Hunk #1 succeeded at 130 with fuzz 1 (offset 7 lines).
Hunk #2 FAILED at 165.
1 out of 2 hunks FAILED -- saving rejects to file views_audio.inc.rej
I tried the patch against the original and the previously patched file.
So I think that could be the reason.
Comment #20
sgriffin commentedChecking the module I have 5.1.0 installed.
Installed and patching against a fresh dev.
Comment #21
drewish commentedthanks, i really do appreciate your help.
as you noticed, that patch was against the clean version of the file.
i've got a suspicion about the cause. looking at http://drupal.org/node/99565 there's a note that when using a sort_handler:
Comment #22
sgriffin commentedYes, it works very good, and with the dev version the option labels are now appearing under sort criteria.
And the player is customizable via views.. Great.
Something I am doing also is replacing the output for the button.. to use swfobject. I guess this should be done with swftools filter, but I don't think it natively supports the button player.
You've helped alot of people. Good work.
Comment #23
sgriffin commentedPerhaps I did not understand.. Using the default sort option for the track field did NOT work .. but sort criteria did work.
Comment #24
drewish commentedokay, i think i've got it worked out. this should work for both table sorting and sort criteria.
Comment #25
sgriffin commentedYou nailed it. Its working perfectly!
Comment #26
drewish commentedGreat, committed to HEAD and DRUPAL-5. Thanks again for your help testing this.
Comment #27
sgriffin commentedI have noticed an issue.. though I have no idea if its related.. When editing the metadata of a track the last one OR two characters of the input field never makes it to the db.
Also when coming from audio import. title and album.
5.x-1.x-dev
Going to install the head instead.
Comment #28
drewish commentedyou ran into http://drupal.org/node/145117
Comment #29
sgriffin commentedtheres something wonky in there.. I reinstalled 5.x.10 and the issue is gone..
The issue exists with the head and dev versions.
Comment #30
sgriffin commentedAh so the dev and head must use v2 from then on..
You rock!
Comment #31
(not verified) commentedComment #32
Fr0s7 commentedRe-opening this for 6.x Views 2:
Sorting by Audio meta-data: Track (ascending) is happening alphabetically instead of numerically. For example, a list of 24 tracks returns this:
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
3
4
5
6
7
8
9
Comment #33
drewish commentedthis is really part of #273082: Add views2 support since it's a matter up upgrading the existing code.