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] can not generate a foreignId-type column in Laravel 11 #74

Closed
fzhantw opened this issue Apr 29, 2024 · 4 comments
Closed

[Bug] can not generate a foreignId-type column in Laravel 11 #74

fzhantw opened this issue Apr 29, 2024 · 4 comments
Assignees
Labels
bug Something isn't working Priority: MUST

Comments

@fzhantw
Copy link

fzhantw commented Apr 29, 2024

Bug report

What I did

  1. Add a column which "Column Type" is "BelongsTo". on path "admin/devtools/model/create"
  2. Press "save"
  3. Error happened

What I expected to happen

Generate model & crud

What happened

error occur as below:
[2024-04-29 17:23:52] local.ERROR: Call to a member function getName() on string {"userId":1,"exception":"[object] (Error(code: 0): Call to a member function getName() on string at /Users/fzhan/Herd/yongchieh/vendor/backpack/devtools/src/Generators/BlueprintGenerator.php:389)
[stacktrace]
#0 [internal function]: Backpack\\DevTools\\Generators\\BlueprintGenerator->Backpack\\DevTools\\Generators\\{closure}('page_metas', '\\x00Backpack\\\\CRUD\\\\...')

What I've already tried to fix it

Try to add a connection name attribute on relation model, but it was not helping.

Backpack, Laravel, PHP, DB version

Laravel 11.5

PHP 8.2.16

DB MySQL 8.2.0

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

backpack/activity-log: 2.0.4
backpack/basset: 1.3.3
backpack/crud: 6.7.11
backpack/devtools: 3.1.3
backpack/editable-columns: 3.0.9
backpack/generators: v4.0.5
backpack/logmanager: v5.0.1
backpack/medialibrary-uploaders: 1.2.0
backpack/pagemanager: 3.3.0
backpack/permissionmanager: 7.2.1
backpack/pro: 2.1.13
backpack/settings: 3.1.1
backpack/theme-tabler: 1.2.10
backpack/translation-manager: 1.0.3

Operating System and Server Setup

MacOS(M1)
Server setup by Herd

@karandatwani92
Copy link

Hey @pxpm please check this.
When i tried, i received different error.

@mfaoficial
Copy link

When i tried i received the same error as @karandatwani92

@pxpm
Copy link

pxpm commented May 8, 2024

Thanks @fzhantw @mfaoficial and @karandatwani92 .

I was able to reproduce both errors and fixed them in 3.1.5.

Our private repository should pick the new version in a few moments and you will be able to get the fixed version with a composer update.

Let me know if you still experiencing the issue 🙏

Cheers

@pxpm pxpm assigned karandatwani92 and unassigned pxpm May 8, 2024
@fzhantw
Copy link
Author

fzhantw commented May 9, 2024

@pxpm
works fine in 3.1.5.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: MUST
Projects
Status: Done
Development

No branches or pull requests

4 participants