Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2012 at 22:15 UTC
Updated:
5 Apr 2012 at 00:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
marvil07 commentedHere the patch, and I am also attaching a view that uses it to provide an example.
Comment #2
marvil07 commentedI am working to let the user customize the rss item guid and adding the method
option_definition()as dereine suggested by IRC.Comment #3
marvil07 commentedHere a new patch. It includes:
Comment #4
marvil07 commentedI forgot to update the view example, here it is :-)
Comment #5
tim.plunkettTriggering the testbot.
Comment #6
dawehnerAs you asked in irc, you could use the tokens of views, so you could use arguments automatically.
Comment #7
dawehnerYou can just use $view->row_index;
Comment #8
marvil07 commentedOK. Hopefully I'll be back at this before tomorrow.
Thanks for the feedback.
Comment #9
dawehnerYou could use the same code like in views_plugin_row_node_rss::render(). There is some additional code for rdf namespaces.
Are these checks really required? I'm wondering whether you could just use $this->view->style_plugin->get_field directly.
Comment #10
marvil07 commentedIt seems like I could not do that. Let me explain:
The style plugin
get_field()method actually calls style pluginrendered_fields()method, which makes the rendering of all fields and at the end of it, unset the row_index data member. So, after using the first time theviews_plugin_row_rss_fields::get_field()method I end up without the variable.Then I guess I can not use it.
I see, I have included it now, but a little modified, because this is a general row plugin, and since rss_namespaces data member is only on node object, I only do the general call.
I remember adding those checks to make it easy to validate(I can not remember an specific case when they are needed, but I think they are OK to be there).
Comment #11
tim.plunkett"Use a 3rd person verb to begin the description of a class", also "render" should be "renders".
Needs
'bool' => TRUEas well"It need to be" should be "It needs to be"
Globally should be lowercase
This section could use some inline docs.
Missing trailing comma
Double space, and the comment should start differently, like the docs say: "beginning with a verb in the form "Does such and such" (third person, as in "This function does such and such", rather than second person imperative "Do such and such")."
Comment #12
marvil07 commentedThanks for the review
Comment #13
tim.plunkettEr, the bool is now on the wrong line. Sorry! I think this is good otherwise.
Comment #14
marvil07 commentedComment #15
tim.plunkettOkay now I just feel like a jerk, but I thought of a couple more things.
See below about replacing 'none' with '';
Could this be replaced by
$this->display->handler->get_field_labels();?If 'none' was replaced with '' as the empty default, these conditionals could be much simpler
.
Comment #16
marvil07 commentedI like those suggestions, thanks!
BTW: You was right get_field_label method do more than I was doing an it is necessary to use it.
Comment #17
tim.plunkettOkay, rerolled with a couple tweaks we discussed on IRC, I rolled it with credit for @marvil07 so this should be good to use with `git am`.
Comment #18
dawehnerThanks for all the work! I did a final review and committed it to 7.x-3.x