Closed (fixed)
Project:
Viewfield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
3 Feb 2010 at 22:21 UTC
Updated:
29 Apr 2011 at 08:40 UTC
Jump to comment: Most recent file
Hey everyone,
I thought I'd start a thread to begin discussion of a Drupal 7 port.... I use this module quite a bit and would love to see us start working together towards a port sooner rather than later. Thoughts?
Cheers,
Ben
| Comment | File | Size | Author |
|---|---|---|---|
| #52 | port-to-d7-704014-52.patch | 28.53 KB | keithm |
| #47 | viewfield-704014-44-no-prefix.patch | 36.88 KB | jamsilver |
| #44 | viewfield-7-5.patch | 37.01 KB | keithm |
| #38 | 02.gif | 51.42 KB | ConradFlashback |
| #38 | 01.gif | 29.44 KB | ConradFlashback |
Comments
Comment #1
ndm commentedVery good idea, I hope to use with module in the future.
Comment #2
sunWe (all of you + me) need to do a major revamp of the field's settings over in #489908: Per field instance default value settings first.
Afterwards, we can port this module to D7, which should be quite easy.
Comment #3
amitaibu@sun,
Re-checking what are the plans for D7? I'd be happy to deprecate og_views in favor of this general module.
Comment #4
ConradFlashback commentedsubscribe, this is a great module.
Comment #5
dsoares commentedsubscribe for the D7 port
Comment #6
zazinteractive commentedWould love it in D7 as well
Comment #7
peter törnstrand commented+1
Comment #8
a.siebel commented+1
Comment #9
fusepilot commented+1000
Comment #10
momper commented+2000
Comment #11
momper commentedComment #12
webankit commented+1
Comment #13
aren cambre commentedsubscribe
Comment #14
Unnamed commentedsubscribe
Comment #15
pepemty commentedSubscribing
Comment #16
kirkcaraway commentedsubcribing
Comment #17
bryancasler commentedsubscribe
Comment #18
pmackay commentedsubscribe
Comment #19
SilviaT commentedsubscribe
Comment #20
keithm commentedI've posted a patch in #489908-8: Per field instance default value settings that addresses the per field instance settings issue. I'm looking for community members to review that patch. As sun says in #2, once that issue is fixed, the port to D7 should be easy.
Comment #21
sw3b commentedsubscribe
Comment #22
Isaaci commentedIs this mean View filed is already ported to Drupal 7?
Thank you
Isaac
Comment #23
ConradFlashback commentedNo Isaaci, we still expect the porting of this very important module.
Subscribe ++
Comment #24
keithm commentedInitial attempt at a D7 port. Definitely alpha code - please check it out and report your experience.
* Initial D7 port
*
* Designed to work in any fieldable entity.
* Legacy tokens (%nid, %author, %viewer) are gone since they don't play
* well with entities. [node:nid] and [current-user:uid] do not cause an extra
* entity load, so these tokens should perform similarly to %nid and %viewer.
* Token module must be enabled for the construction of Placeholder Token list used
* in editing, but the module need not be enabled to render the field itself.
Comment #25
sunNice to hear. However, can you provide a proper patch, please? See http://drupal.org/patch
Comment #26
keithm commentedAs #24 but patch against viewfield-6.x-1.x-dev.
Comment #27
maxime.deg commentedSubscribing
Really useful module
Comment #28
danny_joris commentedsubscribing
Comment #29
valderama commentedsubscribing
Comment #30
keithm commentedSlightly cleaned up version of #26.
Note that to test this patch (and I hope some of you will), you should note three changes from the Drupal 6 version.
1. super_defaults is gone (i.e., "Use a common default value for all nodes if the user does not override it on the node form." on the edit screen), so if you create content before adding your viewfield, you need to go back and supply viewfield values for it just like any other field.
2. Viewfields can now be attached to any fieldable entity (e.g., nodes, comments, users).
3. The legacy tokens (%nid, %author, %viewer) are no longer supported because they don't blend well with the Drupal 7 notion of fieldable entities. When working with nodes, you can substitute [node:nid], [node:author], and [current-user:uid] respectively instead of these legacy tokens. Enable the D7 version of the token module to see a complete list of available tokens. The token module is not required for token substitution, only to see the list of available tokens.
I have successfully converted D6 viewfields to D7 using this patch. To do this, enable the viewfield module then use the Content Migration project in the D7 version of CCK to migrate the field data for D7. You separately have to make sure that your D7 viewfield uses D7 tokens (see #3 above). I haven't worked on migrating D6 tokens to D7 equivalents yet.
Please test this patch.
Comment #31
keithm commentedPlease use this patch instead of #30. That one was created against the older pre-git version of viewfield-6.x.
Comment #32
ConradFlashback commentedThanks keithm. I'm testing your patch and it works.
Sorry, about #30 3):
I have to pass the argument %nid of a view to the viewfield.
I dont understand this tip: "When working with nodes, you can substitute [node:nid], [node:author], and [current-user:uid] respectively instead of these legacy tokens. "
I create a view with an %nid argument. Then I create the viewfield in my content type.
Where I substitute the legacy tokens %nid with the [node:nid]?. I can't find the place in the option of viewfield-field.
Thanks
Comment #33
keithm commentedConradFlashback: Thanks for your review. In #30, note (3) is for people who are used to using the %nid (legacy) token as an argument in their viewfield. What I'm saying there is to use [node:nid] when you want to pass the node id to a view. See attached.
Comment #34
ConradFlashback commentedThanks keithm.
I have not the select list with "Article references" and the field "Arguments" in my version of viewfield, but only the title "default value" and its label.
I can't now verify my installation patch. I will verify tomorrow.
Comment #35
keithm commentedDid you choose any Allowed Views when setting up the field? There is a viewfield bug that is carried over from D6 #1052370: If you don't restrict list of allowed views, viewfield doesn't work. You currently have to choose at least one allowed view.
Comment #36
ConradFlashback commentedYes, I've selected one allowed view. See attached.
Comment #37
keithm commentedConradFlashback: I haven't been able to reproduce your bug yet. Would you please use the attached patch, which fixes some other problems I found, and try again? If you still have the problem, I will need you to give me the steps to reproduce it. Thanks.
Comment #38
ConradFlashback commentedkeithm: OK, now the default value works. Thanks.
I attach 4 images with my work with VF for D7 because the field does not appear in the node.
The process is the same that I use with VF for D6, please confirm me that is right also with this version:
1) I create the view with nid argument
2) I create VF field in content type with token association
3) I create content
4) VF doesn't appear
thanks for all
Comment #39
mraichelson commentedsubscribing
Comment #40
keithm commentedConradFlashback: Nice images and good description of the problem. It looks like you are setting everything up right. I have only seen your problem when the view itself is broken.
Could you please confirm that you are running latest views-7.x-3.x-dev and that your view previews correctly with the nid you are trying to pass? Another way to verify is to create a page display that accepts your nid argument, and verify it works.
Comment #41
alduya commented@ConradFlashback: I had the same problem. Removing the argument form the view (not the view field) solved the problem for me. But I guess this is not the expected behavior.
@keithm: I wanted to configure the view field to always use the default value, but this gave an error "Multiple views are not supported if force default is enabled." while the number of values was set to 1.
I found that on line 131 of viewfield.module:
<?php if ($settings['force_default'] && $field['cardinality'] !== 1) { ?>needed to be:
<?php if ($settings['force_default'] && $field['cardinality'] !== '1') ?>{or:
<?php if ($settings['force_default'] && $field['cardinality'] != 1) { ?>Thank you for the work you have already done.
Comment #42
alduya commentedI made a mistake. Removing the argument only solved part of the problem.
By removing the nid argument, results from all the nodes were showing. I didn't notice that right away.
After some more digging around I found that it is the function viewfield_views_query_alter that prevents the viewfield to show. This function prevents views from loading the node containing the view.
I guess it is up to the maintainer of this module to decide whether or not to allow to load the node that contains the view. Maybe this can be solved with a checkbox 'Allow loading of the node containing the view'?
Comment #43
keithm commentedI am not having a problem using a view with an argument ('Contextual Filter' in the new Views 3 terminology) referenced by a Viewfield.
The following works for me.
If you are having a problem, I need the exact steps to reproduce your problem.
alduya: thanks for the cardinality fix. The call to hook_views_query_alter() is there to prevent infinite recursion, and was there in D6 as well.
Comment #44
keithm commentedLatest patch. Cardinality bug from #41 fixed. Moved 'allowed_views' setting to more appropriate instance (bundle) level.
Comment #45
so4 commentedsubscribing
Comment #46
robertom commentedsubscribe
Comment #47
jamsilver commentedFor my own benefit more than anything else - here is a re-roll of patch #44 that applies cleanly to the latest commit in the git repo (60c15d).
Comment #48
valderama commentedI am using this early port of viewfield and in combination with a link field I get this error (when viewing the node which has a link field):
I guess that viewfield somehow disturbes the link field in some hook, probably.
NOTE: I am not having both, viewfield and link field, on the same node.
Comment #49
keithm commentedI have been added as co-maintainer and I plan on releasing a D7 dev version in the next couple of weeks. I suggest you wait for that version. All of the patches listed above this comment are experimental and will not necessarily upgrade cleanly to the official version.
Comment #50
iler commentedLooking forward to get the dev version for our ongoing development project! A nice way to test this module for bugs before release :)
Comment #51
jason.fisher commented+011100110111010101100010011100110110001101110010011010010110001001100101
Comment #52
keithm commentedPatch from 6.x-2.x for a new 7.x-2.x branch. This is a straight patch that only handles node entities. I plan to roll out full D7 entity support and theming cleanup once this gets in.
Comment #53
ngstigator commentedsubscribe
Comment #54
chemicalroman commentedsubscribe
Comment #55
AndrzejG commentedsubscribe
Comment #56
keithm commentedI pushed a development release 7.x-2.x today in http://drupalcode.org/project/viewfield.git/commit/8bdd173. Please consult the Viewfield project page for important usage information.
This issue has become rather long and has served its purpose. As problems are found in the 7.x branch, please open new issues for them. Thanks.
Comment #57
ConradFlashback commentedthanks keithm. I will test as soon as possible your dev version.