There are some stuff which has to be fixed. There are some wrong named tables etc.
Here is a first version
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | views-722454-8-fix-taxonomy-integration.patch | 21.26 KB | DeFr |
| #5 | views-722454-5-taxonomy.patch | 20.29 KB | DeFr |
| #3 | views-taxonomy-7.patch | 17.59 KB | dawehner |
| views-taxonomy-7.patch | 7.87 KB | dawehner |
Comments
Comment #1
lefnire commentedMore info on this: when you create a Term view (taxonomy as base taxonomy), create page of it, visit that page -- you get the following error:
It seems similar to #763650: PDOException: SQLSTATE[42S02] and #784144: Sort by taxonomy term name throws PDO exception, table not found -- the problem being that some tables were renamed in D7 and not updated in views7. This patch works for me. (How do you trigger simpletest on uploaded patches?)
Comment #2
dawehnerBut this sadly still needs work
Comment #3
dawehnerThis is a minor improvement. Still term_node -> taxonomy_index has to be done.
Comment #4
dawehnerThe central problem here:
Taxonomy_index uses nid, but term_node uses vid, so quite some stuff would have to be changed.
Comment #5
DeFr commentedOk, found this issue when playing with Views on Drupal 7 which prevented further work on a test site, so I took a stab at it. The patch attached is thus the one attached in #3 plus the necessary rename from term_node to taxonomy_index, and takes care of the vid => nid renaming.
It makes the default Taxonomy view almost usable (yeah !), if it weren't for the fact that the node "Published or admin" filter seems completely broken in a fresh checkout, but I'll fill a new issue for that if I don't find an already existing one.
There's something else that seems broken, as I get
Notice: Undefined index: validate_argument_transform dans views_plugin_argument_validate_taxonomy_term->convert_options() (line 68 of /var/www/ows/serie/sites/all/modules/views.git/modules/taxonomywhen viewing the page. I haven't looked into it yet, but I'll do if no one beats me to it.Finally, due to the fact that taxonomy_index no longer contains a vid, but only an nid, there's no way anymore to establish a direct relationship between taxonomy_term_data and node_revisions, like the code used to in D6. I suppose it's ok, as you should be able to add two relationships, to go from node_revision to node and then from node to term, but maybe that should be taken care of in the conversion process ?
Comment #6
DeFr commentedFound the "Published or admin" issue, its #799604: Complex views no longer work, won't talk about it here anymore.
Comment #7
dawehnerThats not totally true. The fieldapi integration has everything you need for relationships/filters/arguments. You can use them. The problem is just, that the place to find it is totally different.
Comment #8
DeFr commentedFound another problem in views_plugin_argument_default_taxonomy_tid.inc when playing around: there's no longer a taxonomy property on the node object. Attached patch iterates over the fields attached to the entity, looking for taxonomy_term_reference one to build an array matching what $node->taxonomy used to look like.
I'm not too sure how to go about adding a generic term_data => node_revisions relationship that doesn't imply adding every taxonomy term reference field table to the query, which is going to be a possibly major performance hit if you have a lot of fields. Maybe that should be an explicit relationship, with a configuration screen, allowing you to choose which field you want to take into account ? Or every taxonomy term reference field should created its own relationship between the terms and node tables ?
Comment #9
BenK commentedSubscribing...
Comment #10
dawehnerThanks for the work DeFr.
Could we split up the patch in
a) just term_data to taxonomy_term_data
This is easy to fix, so let's do it fast.
b) the term_node/term_index part?
From my perspective we should perhaps force people to use fieldapi fields.
Comment #11
fultonchain commentedSubscribing.
Comment #12
dawehnerAfter some discuess the following stuff will be done
* the current term_node relation will be dropped and the user will have to use the fieldapi-fields.
* the existing handlers should be tryed to be ported to fieldapi related handlers.
I suggest to fix the renaming of the not-term_node tables first. Then fix the rest in another issue.
@defr it would be cool if you make a new patch
Just do the renaming and the cool stuff in the argument handlers.
Comment #13
tsvenson commentedsubscribing
Comment #14
will_in_wi commentedSubscribing
Comment #15
dawehnerSo i used the last patch cleaned up quite a bit and commited it. Yeah we have working taxonomy views in d7.
Perhaps we could forget #12
Comment #16
tsvenson commentedCool, will give it a spin on my site over the next days. Let you know how it works.