Skip to content
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

[BUG] Query with apostrophe throws a MySQL statement error #161

Open
adrianmihaila opened this issue Jul 13, 2023 · 1 comment
Open

[BUG] Query with apostrophe throws a MySQL statement error #161

adrianmihaila opened this issue Jul 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@adrianmihaila
Copy link

Describe the bug
I'm using a StackedChart chart type and one of my series has an apostrophe. When I'm trying to render the chart, I receive a MySQL statement error from the TotalRecordsController that says "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's' then 1 else 0 end) as 'Macy's' ..."

To Reproduce

$this->title('Order Ingestion');
$this->model(Order::class);
$this->options([
    'uom' => 'day',
    'showTotal' => false,
    'latestData' => self::HISTORY_DAYS,
]);
$this->series([[
        'label' => 'Macy\'s',
        'filter' => [
            'key' => 'customer_type',
            'value' => 'Macy\'s'
        ],
        'backgroundColor' => '#5e4fa2',
    ]]
);

Expected behavior
A rendered chart like
Screenshot 2023-07-13 at 09 30 24

Dependencies Version (please complete the following information):

  • Laravel Version: 8.83.27
  • Nova Version: 4.20.2
  • Nova-ChartJS Version: 0.4.0

Desktop (please complete the following information):

  • OS: macOS Ventura 13.4
  • Browser Chrome
  • Version 114.0.5735.198
@adrianmihaila
Copy link
Author

I pushed a fix here: #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant