Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
601c922f
Commit
601c922f
authored
Sep 08, 2012
by
aspilicious
Committed by
tim.plunkett
Oct 21, 2012
Browse files
Issue
#1772098
by aspilicious: Camelcase plugin/handler properties.
parent
cabaa7bd
Changes
51
Hide whitespace changes
Inline
Side-by-side
help/api-upgrading.html
View file @
601c922f
...
...
@@ -34,11 +34,11 @@ <h3>Ctools dependency</h3>
<h3>
Changed add_where api
</h3>
If your field is a plain sql field:
<pre>
$this->query->add_where($this->options['group'], "$this->table
_a
lias.$this->real
_f
ield " . $this->operator . " '%s'", $this->value);
$this->query->add_where($this->options['group'], "$this->table
A
lias.$this->real
F
ield " . $this->operator . " '%s'", $this->value);
</pre>
has to be converted to
<pre>
$this->query->add_where($this->options['group'], "$this->table
_a
lias.$this->real
_f
ield", $this->value, $this->operator);
$this->query->add_where($this->options['group'], "$this->table
A
lias.$this->real
F
ield", $this->value, $this->operator);
</pre>
If your field is a complex where condition:
<pre>
...
...
lib/Drupal/views/ManyToOneHelper.php
View file @
601c922f
...
...
@@ -51,7 +51,7 @@ public function getField() {
return
$this
->
handler
->
get_formula
();
}
else
{
return
$this
->
handler
->
table
_a
lias
.
'.'
.
$this
->
handler
->
real
_f
ield
;
return
$this
->
handler
->
table
A
lias
.
'.'
.
$this
->
handler
->
real
F
ield
;
}
}
...
...
@@ -138,7 +138,7 @@ function summary_join() {
foreach
(
$view
->
many_to_one_tables
[
$field
]
as
$value
)
{
$join
->
extra
=
array
(
array
(
'field'
=>
$this
->
handler
->
real
_f
ield
,
'field'
=>
$this
->
handler
->
real
F
ield
,
'operator'
=>
'!='
,
'value'
=>
$value
,
'numeric'
=>
!
empty
(
$this
->
definition
[
'numeric'
]),
...
...
@@ -155,7 +155,7 @@ function summary_join() {
* The operator actually has influence over joining.
*/
public
function
ensureMyTable
()
{
if
(
!
isset
(
$this
->
handler
->
table
_a
lias
))
{
if
(
!
isset
(
$this
->
handler
->
table
A
lias
))
{
// Case 1: Operator is an 'or' and we're not reducing duplicates.
// We hence get the absolute simplest:
$field
=
$this
->
handler
->
relationship
.
'_'
.
$this
->
handler
->
table
.
'.'
.
$this
->
handler
->
field
;
...
...
@@ -167,7 +167,7 @@ public function ensureMyTable() {
if
(
isset
(
$join
))
{
$join
->
type
=
'INNER'
;
}
$this
->
handler
->
table
_a
lias
=
$this
->
handler
->
query
->
ensure_table
(
$this
->
handler
->
table
,
$this
->
handler
->
relationship
,
$join
);
$this
->
handler
->
table
A
lias
=
$this
->
handler
->
query
->
ensure_table
(
$this
->
handler
->
table
,
$this
->
handler
->
relationship
,
$join
);
$this
->
handler
->
view
->
many_to_one_tables
[
$field
]
=
$this
->
handler
->
value
;
}
else
{
...
...
@@ -177,7 +177,7 @@ public function ensureMyTable() {
foreach
(
$this
->
handler
->
view
->
many_to_one_tables
[
$field
]
as
$value
)
{
$join
->
extra
=
array
(
array
(
'field'
=>
$this
->
handler
->
real
_f
ield
,
'field'
=>
$this
->
handler
->
real
F
ield
,
'operator'
=>
'!='
,
'value'
=>
$value
,
'numeric'
=>
!
empty
(
$this
->
handler
->
definition
[
'numeric'
]),
...
...
@@ -186,17 +186,17 @@ public function ensureMyTable() {
}
}
$this
->
handler
->
table
_a
lias
=
$this
->
add_table
(
$join
);
$this
->
handler
->
table
A
lias
=
$this
->
add_table
(
$join
);
}
return
$this
->
handler
->
table
_a
lias
;
return
$this
->
handler
->
table
A
lias
;
}
// Case 2: it's an 'and' or an 'or'.
// We do one join per selected value.
if
(
$this
->
handler
->
operator
!=
'not'
)
{
// Clone the join for each table:
$this
->
handler
->
table
_a
liases
=
array
();
$this
->
handler
->
table
A
liases
=
array
();
foreach
(
$this
->
handler
->
value
as
$value
)
{
$join
=
$this
->
getJoin
();
if
(
$this
->
handler
->
operator
==
'and'
)
{
...
...
@@ -204,7 +204,7 @@ public function ensureMyTable() {
}
$join
->
extra
=
array
(
array
(
'field'
=>
$this
->
handler
->
real
_f
ield
,
'field'
=>
$this
->
handler
->
real
F
ield
,
'value'
=>
$value
,
'numeric'
=>
!
empty
(
$this
->
handler
->
definition
[
'numeric'
]),
),
...
...
@@ -218,11 +218,11 @@ public function ensureMyTable() {
}
$this
->
handler
->
view
->
many_to_one_aliases
[
$field
][
$value
]
=
$this
->
handler
->
table
.
'_value_'
.
(
$this
->
handler
->
view
->
many_to_one_count
[
$this
->
handler
->
table
]
++
);
}
$alias
=
$this
->
handler
->
table
_a
liases
[
$value
]
=
$this
->
add_table
(
$join
,
$this
->
handler
->
view
->
many_to_one_aliases
[
$field
][
$value
]);
$alias
=
$this
->
handler
->
table
A
liases
[
$value
]
=
$this
->
add_table
(
$join
,
$this
->
handler
->
view
->
many_to_one_aliases
[
$field
][
$value
]);
// and set table_alias to the first of these.
if
(
empty
(
$this
->
handler
->
table
_a
lias
))
{
$this
->
handler
->
table
_a
lias
=
$alias
;
if
(
empty
(
$this
->
handler
->
table
A
lias
))
{
$this
->
handler
->
table
A
lias
=
$alias
;
}
}
}
...
...
@@ -236,16 +236,16 @@ public function ensureMyTable() {
$join
->
extra_type
=
'OR'
;
foreach
(
$this
->
handler
->
value
as
$value
)
{
$join
->
extra
[]
=
array
(
'field'
=>
$this
->
handler
->
real
_f
ield
,
'field'
=>
$this
->
handler
->
real
F
ield
,
'value'
=>
$value
,
'numeric'
=>
!
empty
(
$this
->
handler
->
definition
[
'numeric'
]),
);
}
$this
->
handler
->
table
_a
lias
=
$this
->
add_table
(
$join
);
$this
->
handler
->
table
A
lias
=
$this
->
add_table
(
$join
);
}
}
return
$this
->
handler
->
table
_a
lias
;
return
$this
->
handler
->
table
A
lias
;
}
/**
...
...
@@ -310,9 +310,9 @@ function add_filter() {
}
if
(
$add_condition
)
{
$field
=
$this
->
handler
->
real
_f
ield
;
$field
=
$this
->
handler
->
real
F
ield
;
$clause
=
$operator
==
'or'
?
db_or
()
:
db_and
();
foreach
(
$this
->
handler
->
table
_a
liases
as
$value
=>
$alias
)
{
foreach
(
$this
->
handler
->
table
A
liases
as
$value
=>
$alias
)
{
$clause
->
condition
(
"
$alias
.
$field
"
,
$value
);
}
...
...
lib/Drupal/views/Plugin/views/HandlerBase.php
View file @
601c922f
...
...
@@ -32,14 +32,14 @@ abstract class HandlerBase extends PluginBase {
*
* @var string
*/
public
$table
_a
lias
;
public
$table
A
lias
;
/**
* When a table has been moved this property is set.
*
* @var string
*/
public
$actual
_t
able
;
public
$actual
T
able
;
/**
* The actual field in the database table, maybe different
...
...
@@ -47,10 +47,10 @@ abstract class HandlerBase extends PluginBase {
*
* @var string
*/
public
$real
_f
ield
;
public
$real
F
ield
;
/**
* With field you can override the real
_f
ield if the real field is not set.
* With field you can override the real
F
ield if the real field is not set.
*
* @var string
*/
...
...
@@ -61,7 +61,7 @@ abstract class HandlerBase extends PluginBase {
*
* @var string
*/
public
$actual
_f
ield
;
public
$actual
F
ield
;
/**
* The relationship used for this field.
...
...
@@ -96,18 +96,18 @@ public function init(&$view, &$options) {
// option is stored as the plural.
// If the 'moved to' keyword moved our handler, let's fix that now.
if
(
isset
(
$this
->
actual
_t
able
))
{
$options
[
'table'
]
=
$this
->
actual
_t
able
;
if
(
isset
(
$this
->
actual
T
able
))
{
$options
[
'table'
]
=
$this
->
actual
T
able
;
}
if
(
isset
(
$this
->
actual
_f
ield
))
{
$options
[
'field'
]
=
$this
->
actual
_f
ield
;
if
(
isset
(
$this
->
actual
F
ield
))
{
$options
[
'field'
]
=
$this
->
actual
F
ield
;
}
$types
=
View
::
viewsHandlerTypes
();
$plural
=
$this
->
plugin
_t
ype
;
if
(
isset
(
$types
[
$this
->
plugin
_t
ype
][
'plural'
]))
{
$plural
=
$types
[
$this
->
plugin
_t
ype
][
'plural'
];
$plural
=
$this
->
plugin
T
ype
;
if
(
isset
(
$types
[
$this
->
plugin
T
ype
][
'plural'
]))
{
$plural
=
$types
[
$this
->
plugin
T
ype
][
'plural'
];
}
if
(
$this
->
view
->
display_handler
->
isDefaulted
(
$plural
))
{
$display_id
=
'default'
;
...
...
@@ -121,17 +121,17 @@ public function init(&$view, &$options) {
}
if
(
isset
(
$this
->
definition
[
'real field'
]))
{
$this
->
real
_f
ield
=
$this
->
definition
[
'real field'
];
$this
->
real
F
ield
=
$this
->
definition
[
'real field'
];
}
if
(
isset
(
$this
->
definition
[
'field'
]))
{
$this
->
real
_f
ield
=
$this
->
definition
[
'field'
];
$this
->
real
F
ield
=
$this
->
definition
[
'field'
];
}
if
(
isset
(
$options
[
'field'
]))
{
$this
->
field
=
$options
[
'field'
];
if
(
!
isset
(
$this
->
real
_f
ield
))
{
$this
->
real
_f
ield
=
$options
[
'field'
];
if
(
!
isset
(
$this
->
real
F
ield
))
{
$this
->
real
F
ield
=
$options
[
'field'
];
}
}
...
...
@@ -176,7 +176,7 @@ public function getField($field = NULL) {
$field
=
$this
->
get_formula
();
}
else
{
$field
=
$this
->
table
_a
lias
.
'.'
.
$this
->
real
_f
ield
;
$field
=
$this
->
table
A
lias
.
'.'
.
$this
->
real
F
ield
;
}
}
...
...
@@ -528,10 +528,10 @@ public function setRelationship() {
* a lot.
*/
public
function
ensureMyTable
()
{
if
(
!
isset
(
$this
->
table
_a
lias
))
{
$this
->
table
_a
lias
=
$this
->
query
->
ensure_table
(
$this
->
table
,
$this
->
relationship
);
if
(
!
isset
(
$this
->
table
A
lias
))
{
$this
->
table
A
lias
=
$this
->
query
->
ensure_table
(
$this
->
table
,
$this
->
relationship
);
}
return
$this
->
table
_a
lias
;
return
$this
->
table
A
lias
;
}
/**
...
...
lib/Drupal/views/Plugin/views/PluginBase.php
View file @
601c922f
...
...
@@ -36,7 +36,7 @@ abstract class PluginBase extends ComponentPluginBase {
/**
* The plugin type of this plugin, for example style or query.
*/
public
$plugin
_t
ype
=
NULL
;
public
$plugin
T
ype
=
NULL
;
/**
* Denotes whether the plugin has an additional options form.
...
...
@@ -53,12 +53,12 @@ public function __construct(array $configuration, $plugin_id, DiscoveryInterface
$this
->
definition
=
$this
->
discovery
->
getDefinition
(
$plugin_id
)
+
$configuration
;
// @todo Change calls to $this->plugin
_t
ype to use the definition directly.
$this
->
plugin
_t
ype
=
$this
->
definition
[
'plugin_type'
];
// @todo Change calls to $this->plugin
T
ype to use the definition directly.
$this
->
plugin
T
ype
=
$this
->
definition
[
'plugin_type'
];
// @todo Change calls to $this->real_field to use the definition directly.
if
(
isset
(
$this
->
definition
[
'field'
]))
{
$this
->
real
_f
ield
=
$this
->
definition
[
'field'
];
$this
->
real
F
ield
=
$this
->
definition
[
'field'
];
}
$this
->
construct
();
...
...
lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
View file @
601c922f
...
...
@@ -804,7 +804,7 @@ function default_summary() {
function
summary_query
()
{
$this
->
ensureMyTable
();
// Add the field.
$this
->
base_alias
=
$this
->
query
->
add_field
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
);
$this
->
base_alias
=
$this
->
query
->
add_field
(
$this
->
table
A
lias
,
$this
->
real
F
ield
);
$this
->
summary_name_field
();
return
$this
->
summary_basics
();
...
...
@@ -821,11 +821,11 @@ function summary_name_field() {
if
(
isset
(
$this
->
name_table
))
{
// if the alias is different then we're probably added, not ensured,
// so look up the join and add it instead.
if
(
$this
->
table
_a
lias
!=
$this
->
name_table
)
{
if
(
$this
->
table
A
lias
!=
$this
->
name_table
)
{
$j
=
views_get_table_join
(
$this
->
name_table
,
$this
->
table
);
if
(
$j
)
{
$join
=
clone
$j
;
$join
->
left_table
=
$this
->
table
_a
lias
;
$join
->
left_table
=
$this
->
table
A
lias
;
$this
->
name_table_alias
=
$this
->
query
->
add_table
(
$this
->
name_table
,
$this
->
relationship
,
$join
);
}
}
...
...
@@ -834,7 +834,7 @@ function summary_name_field() {
}
}
else
{
$this
->
name_table_alias
=
$this
->
table
_a
lias
;
$this
->
name_table_alias
=
$this
->
table
A
lias
;
}
if
(
isset
(
$this
->
name_field
))
{
...
...
@@ -857,7 +857,7 @@ function summary_basics($count_field = TRUE) {
$this
->
query
->
add_groupby
(
$this
->
name_alias
);
if
(
$count_field
)
{
$this
->
query
->
set_count_field
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
);
$this
->
query
->
set_count_field
(
$this
->
table
A
lias
,
$this
->
real
F
ield
);
}
$this
->
count_alias
=
$count_alias
;
...
...
@@ -908,7 +908,7 @@ function summary_name($data) {
*/
public
function
query
(
$group_by
=
FALSE
)
{
$this
->
ensureMyTable
();
$this
->
query
->
add_where
(
0
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
,
$this
->
argument
);
$this
->
query
->
add_where
(
0
,
"
$this->table
A
lias
.
$this->real
F
ield
"
,
$this
->
argument
);
}
/**
...
...
lib/Drupal/views/Plugin/views/argument/Formula.php
View file @
601c922f
...
...
@@ -39,7 +39,7 @@ public function construct() {
}
function
get_formula
()
{
return
str_replace
(
'***table***'
,
$this
->
table
_a
lias
,
$this
->
formula
);
return
str_replace
(
'***table***'
,
$this
->
table
A
lias
,
$this
->
formula
);
}
/**
...
...
lib/Drupal/views/Plugin/views/argument/ManyToOne.php
View file @
601c922f
...
...
@@ -111,7 +111,7 @@ public function query($group_by = FALSE) {
}
if
(
$empty
)
{
parent
::
ensureMyTable
();
$this
->
query
->
add_where
(
0
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
,
NULL
,
'IS NULL'
);
$this
->
query
->
add_where
(
0
,
"
$this->table
A
lias
.
$this->real
F
ield
"
,
NULL
,
'IS NULL'
);
return
;
}
...
...
@@ -166,14 +166,14 @@ function summary_query() {
}
if
(
empty
(
$this
->
options
[
'add_table'
])
||
empty
(
$this
->
view
->
many_to_one_tables
[
$field
]))
{
$this
->
table
_a
lias
=
$this
->
query
->
ensure_table
(
$this
->
table
,
$this
->
relationship
,
$join
);
$this
->
table
A
lias
=
$this
->
query
->
ensure_table
(
$this
->
table
,
$this
->
relationship
,
$join
);
}
else
{
$this
->
table
_a
lias
=
$this
->
helper
->
summary_join
();
$this
->
table
A
lias
=
$this
->
helper
->
summary_join
();
}
// Add the field.
$this
->
base_alias
=
$this
->
query
->
add_field
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
);
$this
->
base_alias
=
$this
->
query
->
add_field
(
$this
->
table
A
lias
,
$this
->
real
F
ield
);
$this
->
summary_name_field
();
...
...
lib/Drupal/views/Plugin/views/argument/Numeric.php
View file @
601c922f
...
...
@@ -107,15 +107,15 @@ public function query($group_by = FALSE) {
}
$placeholder
=
$this
->
placeholder
();
$null_check
=
empty
(
$this
->
options
[
'not'
])
?
''
:
"OR
$this->table
_a
lias
.
$this->real
_f
ield
IS NULL"
;
$null_check
=
empty
(
$this
->
options
[
'not'
])
?
''
:
"OR
$this->table
A
lias
.
$this->real
F
ield
IS NULL"
;
if
(
count
(
$this
->
value
)
>
1
)
{
$operator
=
empty
(
$this
->
options
[
'not'
])
?
'IN'
:
'NOT IN'
;
$this
->
query
->
add_where_expression
(
0
,
"
$this->table
_a
lias
.
$this->real
_f
ield
$operator
(
$placeholder
)
$null_check
"
,
array
(
$placeholder
=>
$this
->
value
));
$this
->
query
->
add_where_expression
(
0
,
"
$this->table
A
lias
.
$this->real
F
ield
$operator
(
$placeholder
)
$null_check
"
,
array
(
$placeholder
=>
$this
->
value
));
}
else
{
$operator
=
empty
(
$this
->
options
[
'not'
])
?
'='
:
'!='
;
$this
->
query
->
add_where_expression
(
0
,
"
$this->table
_a
lias
.
$this->real
_f
ield
$operator
$placeholder
$null_check
"
,
array
(
$placeholder
=>
$this
->
argument
));
$this
->
query
->
add_where_expression
(
0
,
"
$this->table
A
lias
.
$this->real
F
ield
$operator
$placeholder
$null_check
"
,
array
(
$placeholder
=>
$this
->
argument
));
}
}
...
...
lib/Drupal/views/Plugin/views/argument/String.php
View file @
601c922f
...
...
@@ -147,13 +147,13 @@ function summary_query() {
$this
->
ensureMyTable
();
}
else
{
$this
->
table
_a
lias
=
$this
->
helper
->
summary_join
();
$this
->
table
A
lias
=
$this
->
helper
->
summary_join
();
}
if
(
empty
(
$this
->
options
[
'glossary'
]))
{
// Add the field.
$this
->
base_alias
=
$this
->
query
->
add_field
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
);
$this
->
query
->
set_count_field
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
);
$this
->
base_alias
=
$this
->
query
->
add_field
(
$this
->
table
A
lias
,
$this
->
real
F
ield
);
$this
->
query
->
set_count_field
(
$this
->
table
A
lias
,
$this
->
real
F
ield
);
}
else
{
// Add the field.
...
...
@@ -172,7 +172,7 @@ function summary_query() {
* $this->ensureMyTable() MUST have been called prior to this.
*/
function
get_formula
()
{
return
"SUBSTRING(
$this->table
_a
lias
.
$this->real
_f
ield
, 1, "
.
intval
(
$this
->
options
[
'limit'
])
.
")"
;
return
"SUBSTRING(
$this->table
A
lias
.
$this->real
F
ield
, 1, "
.
intval
(
$this
->
options
[
'limit'
])
.
")"
;
}
/**
...
...
@@ -204,7 +204,7 @@ public function query($group_by = FALSE) {
$this
->
ensureMyTable
();
$formula
=
FALSE
;
if
(
empty
(
$this
->
options
[
'glossary'
]))
{
$field
=
"
$this->table
_a
lias
.
$this->real
_f
ield
"
;
$field
=
"
$this->table
A
lias
.
$this->real
F
ield
"
;
}
else
{
$formula
=
TRUE
;
...
...
lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
View file @
601c922f
...
...
@@ -99,7 +99,7 @@ public function query() {
$this
->
ensureMyTable
();
// Add the field.
$params
=
$this
->
options
[
'group_type'
]
!=
'group'
?
array
(
'function'
=>
$this
->
options
[
'group_type'
])
:
array
();
$this
->
field_alias
=
$this
->
query
->
add_field
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
,
NULL
,
$params
);
$this
->
field_alias
=
$this
->
query
->
add_field
(
$this
->
table
A
lias
,
$this
->
real
F
ield
,
NULL
,
$params
);
$this
->
add_additional_fields
();
}
...
...
@@ -137,7 +137,7 @@ function add_additional_fields($fields = NULL) {
$table_alias
=
$this
->
query
->
ensure_table
(
$info
[
'table'
],
$this
->
relationship
);
}
else
{
$table_alias
=
$this
->
table
_a
lias
;
$table_alias
=
$this
->
table
A
lias
;
}
if
(
empty
(
$table_alias
))
{
...
...
@@ -155,7 +155,7 @@ function add_additional_fields($fields = NULL) {
$this
->
aliases
[
$identifier
]
=
$this
->
query
->
add_field
(
$table_alias
,
$info
[
'field'
],
NULL
,
$params
);
}
else
{
$this
->
aliases
[
$info
]
=
$this
->
query
->
add_field
(
$this
->
table
_a
lias
,
$info
,
NULL
,
$group_params
);
$this
->
aliases
[
$info
]
=
$this
->
query
->
add_field
(
$this
->
table
A
lias
,
$info
,
NULL
,
$group_params
);
}
}
}
...
...
lib/Drupal/views/Plugin/views/filter/BooleanOperator.php
View file @
601c922f
...
...
@@ -163,7 +163,7 @@ public function defaultExposeOptions() {
public
function
query
()
{
$this
->
ensureMyTable
();
$field
=
"
$this->table
_a
lias
.
$this->real
_f
ield
"
;
$field
=
"
$this->table
A
lias
.
$this->real
F
ield
"
;
if
(
empty
(
$this
->
value
))
{
if
(
$this
->
accept_null
)
{
...
...
lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php
View file @
601c922f
...
...
@@ -28,12 +28,12 @@ class BooleanOperatorString extends BooleanOperator {
public
function
query
()
{
$this
->
ensureMyTable
();
$where
=
"
$this->table
_a
lias
.
$this->real
_f
ield
"
;
$where
=
"
$this->table
A
lias
.
$this->real
F
ield
"
;
if
(
empty
(
$this
->
value
))
{
$where
.
=
"= ''"
;
if
(
$this
->
accept_null
)
{
$where
=
'('
.
$where
.
" OR
$this->table
_a
lias
.
$this->real
_f
ield
IS NULL)"
;
$where
=
'('
.
$where
.
" OR
$this->table
A
lias
.
$this->real
F
ield
IS NULL)"
;
}
}
else
{
...
...
lib/Drupal/views/Plugin/views/filter/Combine.php
View file @
601c922f
...
...
@@ -67,7 +67,7 @@ public function query() {
// Always add the table of the selected fields to be sure a table alias exists.
$field
->
ensureMyTable
();
if
(
!
empty
(
$field
->
field_alias
)
&&
!
empty
(
$field
->
field_alias
))
{
$fields
[]
=
"
$field->table
_a
lias
.
$field->real
_f
ield
"
;
$fields
[]
=
"
$field->table
A
lias
.
$field->real
F
ield
"
;
}
}
if
(
$fields
)
{
...
...
lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
View file @
601c922f
...
...
@@ -1369,7 +1369,7 @@ public function storeExposedInput($input, $status) {
*/
public
function
query
()
{
$this
->
ensureMyTable
();
$this
->
query
->
add_where
(
$this
->
options
[
'group'
],
"
$this->table
_a
lias
.
$this->real
_f
ield
"
,
$this
->
value
,
$this
->
operator
);
$this
->
query
->
add_where
(
$this
->
options
[
'group'
],
"
$this->table
A
lias
.
$this->real
F
ield
"
,
$this
->
value
,
$this
->
operator
);
}
/**
...
...
lib/Drupal/views/Plugin/views/filter/InOperator.php
View file @
601c922f
...
...
@@ -380,7 +380,7 @@ function op_simple() {
// We use array_values() because the checkboxes keep keys and that can cause
// array addition problems.
$this
->
query
->
add_where
(
$this
->
options
[
'group'
],
"
$this->table
_a
lias
.
$this->real
_f
ield
"
,
array_values
(
$this
->
value
),
$this
->
operator
);
$this
->
query
->
add_where
(
$this
->
options
[
'group'
],
"
$this->table
A
lias
.
$this->real
F
ield
"
,
array_values
(
$this
->
value
),
$this
->
operator
);
}
function
op_empty
()
{
...
...
@@ -392,7 +392,7 @@ function op_empty() {
$operator
=
"IS NOT NULL"
;
}
$this
->
query
->
add_where
(
$this
->
options
[
'group'
],
"
$this->table
_a
lias
.
$this->real
_f
ield
"
,
NULL
,
$operator
);
$this
->
query
->
add_where
(
$this
->
options
[
'group'
],
"
$this->table
A
lias
.
$this->real
F
ield
"
,
NULL
,
$operator
);
}
public
function
validate
()
{
...
...
lib/Drupal/views/Plugin/views/filter/Numeric.php
View file @
601c922f
...
...
@@ -245,7 +245,7 @@ function value_form(&$form, &$form_state) {
public
function
query
()
{
$this
->
ensureMyTable
();
$field
=
"
$this->table
_a
lias
.
$this->real
_f
ield
"
;
$field
=
"
$this->table
A
lias
.
$this->real
F
ield
"
;
$info
=
$this
->
operators
();
if
(
!
empty
(
$info
[
$this
->
operator
][
'method'
]))
{
...
...
lib/Drupal/views/Plugin/views/filter/String.php
View file @
601c922f
...
...
@@ -254,7 +254,7 @@ function operator() {
*/
public
function
query
()
{
$this
->
ensureMyTable
();
$field
=
"
$this->table
_a
lias
.
$this->real
_f
ield
"
;
$field
=
"
$this->table
A
lias
.
$this->real
F
ield
"
;
$info
=
$this
->
operators
();
if
(
!
empty
(
$info
[
$this
->
operator
][
'method'
]))
{
...
...
lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php
View file @
601c922f
...
...
@@ -348,7 +348,7 @@ public function query() {
$def
=
$this
->
definition
;
$def
[
'table'
]
=
$this
->
definition
[
'base'
];
$def
[
'field'
]
=
$base_field
;
$def
[
'left_table'
]
=
$this
->
table
_a
lias
;
$def
[
'left_table'
]
=
$this
->
table
A
lias
;
$def
[
'left_field'
]
=
$this
->
field
;
if
(
!
empty
(
$this
->
options
[
'required'
]))
{
$def
[
'type'
]
=
'INNER'
;
...
...
lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php
View file @
601c922f
...
...
@@ -54,9 +54,9 @@ public function init(&$view, &$options) {
$this
->
table
=
$this
->
definition
[
'relationship table'
];
}
if
(
isset
(
$this
->
definition
[
'relationship field'
]))
{
// Set both real
_f
ield and field so custom handler
//
can rely on the old
field value.
$this
->
real
_f
ield
=
$this
->
field
=
$this
->
definition
[
'relationship field'
];
// Set both real
F
ield and field so custom handler
can rely on the old
// field value.
$this
->
real
F
ield
=
$this
->
field
=
$this
->
definition
[
'relationship field'
];
}
}
...
...
@@ -123,8 +123,8 @@ public function query() {
$def
=
$this
->
definition
;
$def
[
'table'
]
=
$this
->
definition
[
'base'
];
$def
[
'field'
]
=
$base_field
;
$def
[
'left_table'
]
=
$this
->
table
_a
lias
;
$def
[
'left_field'
]
=
$this
->
real
_f
ield
;
$def
[
'left_table'
]
=
$this
->
table
A
lias
;
$def
[
'left_field'
]
=
$this
->
real
F
ield
;
if
(
!
empty
(
$this
->
options
[
'required'
]))
{
$def
[
'type'
]
=
'INNER'
;
}
...
...
lib/Drupal/views/Plugin/views/sort/Date.php
View file @
601c922f
...
...
@@ -56,27 +56,27 @@ public function query() {
switch
(
$this
->
options
[
'granularity'
])
{
case
'second'
:
default
:
$this
->
query
->
add_orderby
(
$this
->
table
_a
lias
,
$this
->
real
_f
ield
,
$this
->
options
[
'order'
]);
$this
->
query
->
add_orderby
(
$this
->
table
A
lias
,
$this
->
real
F
ield
,
$this
->
options
[
'order'
]);
return
;
case
'minute'
:
$formula
=
views_date_sql_format
(
'YmdHi'
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
);
$formula
=
views_date_sql_format
(
'YmdHi'
,
"
$this->table
A
lias
.
$this->real
F
ield
"
);
break
;
case
'hour'
:
$formula
=
views_date_sql_format
(
'YmdH'
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
);
$formula
=
views_date_sql_format
(
'YmdH'
,
"
$this->table
A
lias
.
$this->real
F
ield
"
);
break
;
case
'day'
:
$formula
=
views_date_sql_format
(
'Ymd'
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
);
$formula
=
views_date_sql_format
(
'Ymd'
,
"
$this->table
A
lias
.
$this->real
F
ield
"
);
break
;
case
'month'
:
$formula
=
views_date_sql_format
(
'Ym'
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
);
$formula
=
views_date_sql_format
(
'Ym'
,
"
$this->table
A
lias
.
$this->real
F
ield
"
);
break
;
case
'year'
:
$formula
=
views_date_sql_format
(
'Y'
,
"
$this->table
_a
lias
.
$this->real
_f
ield
"
);
$formula
=
views_date_sql_format
(
'Y'
,
"
$this->table
A
lias
.
$this->real
F
ield
"
);
break
;
}
// Add the field.
$this
->
query
->
add_orderby
(
NULL
,
$formula
,
$this
->
options
[
'order'
],
$this
->
table
_a
lias
.
'_'
.
$this
->
field
.
'_'
.
$this
->
options
[
'granularity'
]);