Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
views_natural_sort
Commits
eb49881f
Commit
eb49881f
authored
Jan 29, 2013
by
generalredneck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#1614234
] Fixing bug with cardinality and making join work on the right db_column.
parent
bfc9734c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
handlers/views_natural_sort_handler_sort_text_field.inc
handlers/views_natural_sort_handler_sort_text_field.inc
+15
-3
No files found.
handlers/views_natural_sort_handler_sort_text_field.inc
View file @
eb49881f
...
...
@@ -5,21 +5,33 @@ class views_natural_sort_handler_sort_text_field extends views_natural_sort_hand
$join
=
new
views_join
();
$other_join
=
$this
->
get_join
();
$table_data
=
views_fetch_data
(
$other_join
->
definition
[
'left_table'
]);
// If you look at where natural_sort_join is called, this alias will be used.
$vns_alias
=
'vns_'
.
$this
->
table_alias
;
// Make the join. Can't use extra as an array because I have to join on two
// fields and not 1 field with other fields == to a hard coded value.
// I don't like this because it's insecure. Look for better way.
// @see http://drupal.org/node/1090432
$join
->
definition
=
array
(
'table'
=>
'views_natural_sort'
,
'field'
=>
'eid'
,
'left_field'
=>
'entity_id'
,
'left_table'
=>
$this
->
table_alias
,
'extra'
=>
array
(
'extra'
=>
$vns_alias
.
'.delta = '
.
$this
->
table_alias
.
'.delta AND '
.
$vns_alias
.
".entity_type = '"
.
$table_data
[
'table'
][
'entity type'
]
.
"' AND "
.
$vns_alias
.
".field = '"
.
preg_replace
(
'/_value$/'
,
''
,
$this
->
field
)
.
"'"
,
/*'extra' => array(
"views_natural_sort.delta = $this->table_alias.delta",
array(
'field' => 'entity_type',
'value' => $table_data['table']['entity type'],
),
array(
'field' => 'field',
'value'
=>
$this
->
real_
field
,
'value' =>
preg_replace('/_value$/', '',
$this->field
)
,
),
)
)
*/
);
$join
->
construct
();
$join
->
adjusted
=
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment