Laravel-Backpack / NewsCRUD

An admin panel for news with categories and tags, using Backpack CRUD on Laravel 10
http://backpackforlaravel.com
Other
233 stars 51 forks source link

Not compatible with SQLite #55

Closed Polfo closed 3 years ago

Polfo commented 3 years ago

Bug report

When I run the backpack demo locally on my machine, and I want to edit or add an Article, the following error occurs:

SQLSTATE[HY000]: General error: 1 near "SHOW": syntax error 
(SQL: SHOW COLUMNS FROM `articles` WHERE Field = "status")

What I expected:

Specific error message that Enum is not supported when using SQLite

What I've already tried to fix it:

https://github.com/Laravel-Backpack/NewsCRUD/blob/b3f790eb4c1cc04376dbc4168a2f78bcec9c4294/src/app/Http/Controllers/Admin/ArticleCrudController.php#L152 modified to

$this->crud->addField([
    'name' => 'status',
    'label' => 'Status',
    // 'type' => 'enum', // not supported by SQLite
    'type' => 'select_from_array',
    'options'  => [
        'PUBLISHED' => 'PUBLISHED', 
        'DRAFT' => 'DRAFT',
    ],
]);

Backpack, Laravel, PHP, DB version:

laravel/framework v8.1.0 backpack/newscrud v4.0.3 backpack/crud 4.1.22 PHP 7.4.9 SQLite 3

welcome[bot] commented 3 years ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

pxpm commented 3 years ago

Hello @Polfo would you like to submit a PR for it ?

If you can't don't mind I would do it no problem at all, just let me know :)

Thanks for raising the issue!

Best, Pedro

Polfo commented 3 years ago

Just closed by accident: intention was to close a window, not the issue. So reopened now.

promatik commented 3 years ago

Hi everyone, I've just created a PR to fix this issue on https://github.com/Laravel-Backpack/CRUD/pull/3788. Let's keep the conversation there ✌