Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
views_natural_sort
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
views_natural_sort
Commits
8ff9e52c
Commit
8ff9e52c
authored
Jan 18, 2013
by
generalredneck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#1614234
] Adding delta field to the database for cardinality > 1
parent
e6368a2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
views_natural_sort.install
views_natural_sort.install
+26
-2
views_natural_sort.views.inc
views_natural_sort.views.inc
+0
-1
No files found.
views_natural_sort.install
View file @
8ff9e52c
...
...
@@ -34,6 +34,13 @@ function views_natural_sort_schema() {
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'delta'
=>
array
(
'description'
=>
t
(
'The sequence number for this data item, used for multi-value fields'
),
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'not null'
=>
TRUE
,
'default'
=>
0
,
),
'content'
=>
array
(
'description'
=>
t
(
'Filtered content used for sorting.'
),
'type'
=>
'varchar'
,
...
...
@@ -42,7 +49,7 @@ function views_natural_sort_schema() {
'default'
=>
''
,
),
),
'primary key'
=>
array
(
'eid'
,
'entity_type'
,
'field'
),
'primary key'
=>
array
(
'eid'
,
'entity_type'
,
'field'
,
'delta'
),
);
return
$schema
;
...
...
@@ -100,6 +107,12 @@ function views_natural_sort_update_7001() {
module_load_include
(
'inc'
,
'views_natural_sort'
,
'views_natural_sort.admin'
);
views_natural_sort_rebuild_index_submit
();
}
/**
* Impliments hook_update_N().
*
* Upgrade the 7.x-1.x table structure to the 7.x-2.x table structure.
*/
function
views_natural_sort_update_7200
()
{
db_drop_primary_key
(
'views_natural_sort'
);
db_add_field
(
...
...
@@ -113,6 +126,17 @@ function views_natural_sort_update_7200() {
'default'
=>
'node'
)
);
db_add_field
(
'views_natural_sort'
,
'delta'
,
array
(
'description'
=>
t
(
'The sequence number for this data item, used for multi-value fields'
),
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'not null'
=>
TRUE
,
'default'
=>
0
,
)
);
db_change_field
(
'views_natural_sort'
,
'nid'
,
...
...
@@ -124,7 +148,7 @@ function views_natural_sort_update_7200() {
'not null'
=>
TRUE
,
),
array
(
'primary key'
=>
array
(
'eid'
,
'entity_type'
,
'field'
),
'primary key'
=>
array
(
'eid'
,
'entity_type'
,
'field'
,
'delta'
),
)
);
}
views_natural_sort.views.inc
View file @
8ff9e52c
...
...
@@ -8,7 +8,6 @@
*/
function
views_natural_sort_views_data_alter
(
&
$data
)
{
// TODO: Add a field and argument handler to support grouping.
$data
[
'node'
][
'title'
][
'sort'
][
'handler'
]
=
'views_natural_sort_handler_sort'
;
}
...
...
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