Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3485117
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3485117
Commits
7786d91c
Commit
7786d91c
authored
9 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2451749
by amateescu, bzrudi71, jaredsmith: PostgreSQL: Fix views\src\Tests\GlossaryTest.php
parent
b15e4ffb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/views/src/Plugin/views/argument/StringArgument.php
+28
-5
28 additions, 5 deletions
...odules/views/src/Plugin/views/argument/StringArgument.php
with
28 additions
and
5 deletions
core/modules/views/src/Plugin/views/argument/StringArgument.php
+
28
−
5
View file @
7786d91c
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\views\Plugin\views\argument
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\views\ViewExecutable
;
...
...
@@ -179,11 +180,19 @@ protected function summaryQuery() {
public
function
getFormula
()
{
$formula
=
"SUBSTRING(
$this->tableAlias
.
$this->realField
, 1, "
.
intval
(
$this
->
options
[
'limit'
])
.
")"
;
// Support case-insensitive substring comparisons for SQLite by using the
// 'NOCASE_UTF8' collation.
// @see Drupal\Core\Database\Driver\sqlite\Connection::open()
if
(
Database
::
getConnection
()
->
databaseType
()
==
'sqlite'
&&
$this
->
options
[
'case'
]
!=
'none'
)
{
$formula
.
=
' COLLATE NOCASE_UTF8'
;
if
(
$this
->
options
[
'case'
]
!=
'none'
)
{
// Support case-insensitive substring comparisons for SQLite by using the
// 'NOCASE_UTF8' collation.
// @see Drupal\Core\Database\Driver\sqlite\Connection::open()
if
(
Database
::
getConnection
()
->
databaseType
()
==
'sqlite'
)
{
$formula
.
=
' COLLATE NOCASE_UTF8'
;
}
// Support case-insensitive substring comparisons for PostgreSQL by
// converting the formula to lowercase.
if
(
Database
::
getConnection
()
->
databaseType
()
==
'pgsql'
)
{
$formula
=
'LOWER('
.
$formula
.
')'
;
}
}
return
$formula
;
}
...
...
@@ -205,6 +214,14 @@ public function query($group_by = FALSE) {
$this
->
operator
=
'or'
;
}
// Support case-insensitive substring comparisons for PostgreSQL by
// converting the arguments to lowercase.
if
(
$this
->
options
[
'case'
]
!=
'none'
&&
Database
::
getConnection
()
->
databaseType
()
==
'pgsql'
)
{
foreach
(
$this
->
value
as
$key
=>
$value
)
{
$this
->
value
[
$key
]
=
Unicode
::
strtolower
(
$value
);
}
}
if
(
!
empty
(
$this
->
definition
[
'many to one'
]))
{
if
(
!
empty
(
$this
->
options
[
'glossary'
]))
{
$this
->
helper
->
formula
=
TRUE
;
...
...
@@ -266,6 +283,12 @@ public function getSortName() {
}
function
title
()
{
// Support case-insensitive title comparisons for PostgreSQL by converting
// the title to lowercase.
if
(
$this
->
options
[
'case'
]
!=
'none'
&&
Database
::
getConnection
()
->
databaseType
()
==
'pgsql'
)
{
$this
->
options
[
'case'
]
=
'lower'
;
}
$this
->
argument
=
$this
->
caseTransform
(
$this
->
argument
,
$this
->
options
[
'case'
]);
if
(
!
empty
(
$this
->
options
[
'transform_dash'
]))
{
$this
->
argument
=
strtr
(
$this
->
argument
,
'-'
,
' '
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment