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] [Feature] Improve error message when table has not been migrated #5528

Closed
Kasparsu opened this issue May 30, 2024 · 5 comments
Closed
Assignees
Labels
Has Fix Minor Bug A bug that happens only in a very niche or specific use case.

Comments

@Kasparsu
Copy link
Contributor

Kasparsu commented May 30, 2024

Bug report

What I did

Open newly created crud while forgetting to migrate the table it was generated on

What I expected to happen

Nice error message telling me that hey we did not find table this crud was generated for maybe you forgot to migrate

What happened

nondescript and super unhelpful stacktrace
image

What I've already tried to fix it

Migrated the table.

Is it a bug in the latest version of Backpack?

After I run composer update backpack/crud the bug... is it still there?
yes

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

8.2.4

PHP EXTENSIONS:

Core, bcmath, calendar, ctype, date, filter, hash, iconv, json, SPL, pcre, random, readline, Reflection, session, standard, mysqlnd, tokenizer, zlib, libxml, dom, PDO, openssl, SimpleXML, xml, xmlreader, xmlwriter, curl, fileinfo, mbstring, Phar, pdo_mysql, pdo_sqlite

LARAVEL VERSION:

11.9.1.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.3.4
backpack/crud: 6.7.14
backpack/generators: v4.0.5
backpack/theme-tabler: 1.2.10

Copy link

welcome bot commented May 30, 2024

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 channels:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;
  • Showing off something you've made, asking for opinion on Backpack/Laravel matters - Reddit;

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

@Kasparsu
Copy link
Contributor Author

Seems this is a bug after all. Nice Backpack exceptions are giving this nondescript error because laravel 11.x is not happy about how routes are registered by Backpack.

@Kasparsu
Copy link
Contributor Author

Kasparsu commented May 30, 2024

And it seems to be that Exceptions not rendering correctly was laravel issue
laravel/framework#51614
when fix is applied exception when table hasn't been migrated is much more reasonable
image

This issue can be closed when laravel v11.9.2 is released 11.10.0

@pxpm
Copy link
Contributor

pxpm commented May 30, 2024

Thanks @Kasparsu for the report and for gathering all the info 🙏

I started reading your issue report without noticing your further replies and I was thinking to myself that this should be an issue in Laravel, we don't do any magic tricks to the exception, since it's from an "ajax call", the search endpoint, we render it nicely in an iframe, or the error would be hidden in the browser network tab and not visible for the developer.

Nice find about the Laravel issue. 🙏

I will keep this open until Laravel releases the fixed version.

Thanks again! 🙏

@pxpm pxpm added Minor Bug A bug that happens only in a very niche or specific use case. Has Fix and removed triage labels May 30, 2024
@pxpm pxpm self-assigned this May 30, 2024
@Kasparsu
Copy link
Contributor Author

Kasparsu commented Jun 1, 2024

Laravel 11.9.2 has been released including the fix mentioned above making this issue solved. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Has Fix Minor Bug A bug that happens only in a very niche or specific use case.
Projects
Status: Done
Development

No branches or pull requests

2 participants