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] Backpack does not guess attributes in subfields #5606

Open
susanu opened this issue Aug 14, 2024 · 1 comment · May be fixed by #5611
Open

[Bug] Backpack does not guess attributes in subfields #5606

susanu opened this issue Aug 14, 2024 · 1 comment · May be fixed by #5611

Comments

@susanu
Copy link
Contributor

susanu commented Aug 14, 2024

Bug report

Backpack does not guess the column attributes for subfields.
Create a HasMany relationship and try to display it like in the example below.

CRUD::column('articles')->type('relationship')->subfields([['name' => 'category_id']]);
Undefined array key "type"

Is it a bug in the latest version of Backpack?

Yes

Backpack, Laravel, PHP, DB version

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

### PHP VERSION:
8.3.9

### PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, imap, intl, ldap, exif, msgpack, mysqli, pcov, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, memcached, swoole, Zend OPcache, xdebug

### LARAVEL VERSION:
11.20.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.5
backpack/crud: 6.7.26
backpack/filemanager: 3.0.8
backpack/pagemanager: 3.3.0
backpack/permissionmanager: 7.2.1
backpack/pro: 2.1.7
backpack/theme-tabler: 1.2.11
@susanu susanu added the triage label Aug 14, 2024
@susanu susanu changed the title [Bug] [Bug] Backpack does not guess attributes in subfields Aug 14, 2024
@pxpm
Copy link
Contributor

pxpm commented Aug 14, 2024

Hey @susanu indeed there is an inconsistency here that we should probably address, but i've already spent quite some time today trying to make this work, and it doesn't have a simple solution.

Inferring the attributes is not the biggest issue, but it breaks other parts of the functionality like the linkTo() macros for example. And it may be a breaking change also in other places I am not aware now.

I will postpone working on this on the next major version so that we can confidently introduce this, even with unknown breaking changes that we can document/fix when discovered.

For now, we need to keep manually adding the attributes to subfields in the columns.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants