I'd like to use $view->results() with some confidence, so that I can take advantage of the query building engine. I read http://drupal.org/node/465142 and I see that's not advisable, but even looking at the view->field component the fields are not consistent with database field naming of course.

How about, when I'm editing the view, say a field has a new setting "field alias". When the view is saved, this string is saved on the field definition.

Now, when views_handler_field.inc is running, it passes this "field alias" setting as the third $alias parameter to views_plugin_query_default->add_field()

add_field() still avoids collision on the alias, but then there would be confidence about pulling fields off the $view->result. Another benefit is that a thorough views editor would be able to set all field aliases so that the resulting query is much more readable and easy to debug.

I realise this functionality would need to be implemented by the other field handlers, but it is otherwise pretty simple yes?

Comments

MustangGB’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)