Comments (5)
Fixed in 62c3936
from craft-retour.
Interesting.
from craft-retour.
This is what the query looks like:
// Query the db table
$offset = ($page - 1) * $per_page;
$query = (new Query())
->from(['{{%retour_static_redirects}}'])
->offset($offset)
->limit($per_page)
->orderBy("{$sortField} {$sortType}");
if ($filter !== '') {
$query->where("`redirectSrcUrl` LIKE '%{$filter}%'");
$query->orWhere("`redirectDestUrl` LIKE '%{$filter}%'");
}
I'm a little confused, as I am specifying the table in the from
?
from craft-retour.
Couple things to consider with PostgreSQL:
- The column quote char is
"
, not a backtick like MySQL - Column names are normalized to lowercase unless correctly quoted.
So that’s why your redirectSrcUrl
column is showing up as redirectsrcurl
in the SQL error.
Easiest way to deal with it is to use Yii’s like
query builder condition syntax, which will auto-quote the column names for you with the correct characters, and auto-add %
's to the beginning/end of the search value by default.
if ($filter !== '') {
$query->where(['like', 'redirectSrcUrl', $filter]);
$query->orWhere(['like', 'redirectDestUrl', $filter]);
}
See the QueryInterface::where() API docs for more info on the condition syntaxes Yii supports.
from craft-retour.
Ahhh this makes sense. Thanks @brandonkelly
from craft-retour.
Related Issues (20)
- Automatically created redirects don't work if the base URL includes a path HOT 15
- Is it possible to disable all redirects temporarily? HOT 2
- Wrong `fileNotFoundUrl`in Dashboard HOT 5
- PDOException when url contains invalid UTF8 string HOT 5
- 404 data & redirect additions not displaying in control panel HOT 5
- Extra language parameter added HOT 1
- 410 Gone twig template HOT 6
- [Craft 3] One of retours migrations failed HOT 4
- Add logging of excluded patterns, and disallow empty patterns HOT 1
- Composer error when trying to upgrade to Craft 5 HOT 1
- Sort arrow is upside-down HOT 4
- Short link fields not working for external assets HOT 5
- Short Link field in table listing view causing error "Return value must be of type string, null returned" HOT 3
- Can't access plugin dashboard templates HOT 10
- Potentially valid redirects being deleted HOT 4
- Template Error When installing on Craft 3 HOT 1
- Integrity constraint violation errors being logged HOT 3
- Redirects list cached? Craft Cloud hosting. HOT 8
- 3.2.17 breaks website: Exception 'ParseError' with message 'syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)' HOT 1
- URL gives 404 but is not logged in dashboard HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-retour.