-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addToUrl hängt ein "_local=..." als GET-Parameter an #1257
Comments
|
/cc @aschempp |
|
Fixed in a21e52b. |
|
THX! |
leofeyer
pushed a commit
that referenced
this issue
Feb 7, 2020
Description
-----------
In a project of ours we dynamically injected a DCA filter into
```php
$GLOBALS['TL_DCA']['tl_foo']['list']['sorting']['filter']
```
via an `onload_callback`. However, in our case we wanted to add a query like this:
```sql
foo NOT IN (…)
```
Initially we added the filter like this:
```php
$GLOBALS['TL_DCA']['tl_foo']['list']['sorting']['filter'][] = ['foo NOT IN ('.implode(',', $ids).')'];
```
However, since Contao assumes that these filters are _always_ a placeholder/value pair, the placeholders and values will mismatch in the final query and thus it results in a wrong SQL query, when user defined filter is selected for example.
As a workaround we implemented it like this:
```php
$GLOBALS['TL_DCA']['tl_foo']['list']['sorting']['filter'][] = ['(foo NOT IN ('.implode(',', $ids).') AND 1=?)', 1];
```
so that there is no placeholder/value mismatch anymore. But it would be convenient (and would save some debugging time …) if one could simply define a filter without a placeholder like this:
```php
$GLOBALS['TL_DCA']['tl_foo']['list']['sorting']['filter'][] = 'foo NOT IN ('.implode(',', $ids).')';
```
This PR would allow that.
Commits
-------
497a3abc Allow definition of filters without placeholder values
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wird in einem Template eine URL-Generierung erzeugt
wird ein
_locale=deals GET-Parameter angehangen und nach erneutem Aufruf ist der Parameter "in der URL" als /_locale/de ... nach erneutem Aufruf kommt eine 404siehe https://github.com/contao/core-bundle/blob/master/src/Resources/contao/classes/Frontend.php#L441
Workaround:
..._locale=&mit als Parameter in die addToUrlC 4.4.8
The text was updated successfully, but these errors were encountered: