-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error with escaping "rows" and MariaDB #40
Comments
Please put your error and log messages in three back ticks, not one. |
Presumably, /**
* Fetch value from database.
*
* @param DataContainer $dataContainer Data container driver.
* @param string $strSelector Selector field name.
*
* @return mixed
*/
private function fetchValueFromDatabase($dataContainer, $strSelector)
{
$objRecord = \Database::getInstance()
- ->prepare(sprintf('SELECT %s FROM %s WHERE id=?', $strSelector, $dataContainer->table))
+ ->prepare(sprintf('SELECT `%s` FROM `%s` WHERE id=?', $strSelector, $dataContainer->table))
->limit(1)
->execute($dataContainer->id);
if ($objRecord->next()) {
return $objRecord->$strSelector;
}
return null;
} |
@fritzmg Thanks for finding and solving the error, your solution works like a charm! In 4.6.6 and 4.6.8 the error is solved with your change. And jepp, back ticks and me, we do know, why we hate each other ;) |
It should be fixed with 842693d. Instead of @fritzmg approach I also switched to doctrine/dbal. @Paddy0174 It would be great if you would check branch hotfix/2.0.5 if it fixes your issue in the mariadb context. |
@dmolineus Thanks, works like a charme. Fixes the issue and doesn't seem to disturb anything else, like contao-bootstrap! :) Thanks for the fast reaction! :) |
Thanks for confirming that it works. Shipped with the 2.0.5 release. |
I have an error with the correct escaping for the reserved word "rows" in tl_layout. This issue was discovered in contao-core before (see #153 ).
Unfortunately I have now the same issue with meta-palettes. See this thread in the board:
click here
@fritzmg found the error in SubSelectPalettesListener.php in line 304
Now all the data you might need, it's an uberspace7 server:
My composer.json
And the stack trace from app_dev:
If you need more information, please let me know
The text was updated successfully, but these errors were encountered: